Posted: 2007-01-30T07:49:00-07:00
Improving text rendering performance is still on our todo list with no ETA available.
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=6171
Code: Select all
//render the text
MagickCore::MagickWand *wand=MagickCore::NewMagickWand();
MagickCore::MagickSetSize(wand, TextWidth, 0);
MagickCore::MagickSetPointsize(wand, 12);
MagickCore::MagickSetOption(wand, "fill", "black");
MagickCore::MagickSetOption(wand, "background", "transparent");
MagickCore::MagickSetGravity(wand, MagickCore::NorthWestGravity);
MagickCore::MagickReadImage(wand, (std::string("caption:")+Text).c_str());
//save the pixels for later
textHeight=MagickCore::MagickGetImageHeight(wand);
textPixels.resize(TextWidth*textHeight);
MagickCore::MagickExportImagePixels(wand, 0, 0, TextWidth, textHeight, "RGBA", MagickCore::CharPixel, &textPixels[0]);