示例#1
0
Magick::Blob ImgMgk::conv(const void *data, size_t length, const std::string &text)
{
    Magick::Blob blob1;
    Magick::Blob blob(data,length);

    try
    {
        Magick::Image image;
        image.read(blob);

        image.annotate(text, Magick::SouthEastGravity);

        image.magick("JPEG"); // Set JPEG output format
        image.write(&blob1);
    }
    catch( std::exception &error_ )
    {
        Log::err("Caught exception: %s", error_.what());
        return blob;
    }

    return blob1;
}
示例#2
0
void Magick::annotateImage::operator()( Magick::Image &image_ ) const
{
  image_.annotate( _text, _geometry, _gravity, _degrees );
}