troubleshooting Question

How can I wrap text in an Image using magickwand?

Avatar of Web_Sight
Web_Sight asked on
Programming Languages-OtherProgrammingWeb Development Software
5 Comments3 Solutions586 ViewsLast Modified:
Hi,

I am using a textarea for inputing text and need to embed the text to an image. Here is my code in a simlified form.

$magick_wand=NewMagickWand();
MagickReadImage($magick_wand,'customland.png');


$drawing_wand=NewDrawingWand();
DrawSetFont($drawing_wand,"Fonts/arial.ttf");
DrawSetFontSize($drawing_wand,100);
DrawSetGravity($drawing_wand,MW_CenterGravity);
$pixel_wand=NewPixelWand();
PixelSetColor($pixel_wand,"red");
DrawSetFillColor($drawing_wand,$pixel_wand);

if (MagickAnnotateImage($magick_wand,$drawing_wand,0,0,0,"Red Roses") != 0)
{

MagickEchoImageBlob( $magick_wand );
}
else
{
echo MagickGetExceptionString($magick_wand);
}.


In this case "Red Roses" is my text and it is working fine. But when I am working with long text, it will coming out of the image. I need to wrap up the text enterd. Is there any way to wrap the text? Please help me.
Thanking in advance.
ASKER CERTIFIED SOLUTION
harris_c

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 3 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros