Page 1 of 1

Fill text with a pattern from an external image

Posted: 2007-11-30T07:17:06-07:00
by mkoppanen
Is there any way i can fill te text with a pattern from an external image?

Re: Fill text with a pattern from an external image

Posted: 2007-11-30T10:14:30-07:00
by magick
You can generate patterns with DrawPushPattern(), DrawPopPattern(), and DrawSetFillPatternURL(). However, we will add a new method for setting the fill pattern and then rendering the pattern with the MagickAnnotateImage() method. We will try to get a patch in by the next release of ImageMagick.

Re: Fill text with a pattern from an external image

Posted: 2007-11-30T18:43:13-07:00
by mkoppanen
Thank you!

Re: Fill text with a pattern from an external image

Posted: 2008-03-23T09:49:57-07:00
by web_artist
Is this "solved" ? ... how can I add a pattern to a certain text ?

Thanks :-)

Re: Fill text with a pattern from an external image

Posted: 2008-03-23T15:14:32-07:00
by magick
Try DrawSetFillPatternURL() and use a file:// URL to define the drawing pattern.

Re: Fill text with a pattern from an external image

Posted: 2008-03-24T12:38:57-07:00
by web_artist
I did that, but with no success.
Any thoughts ? :?

<?php
$im = new Imagick();
$im->newImage(200, 200, "#FFFFFF", "png");


$draw = new ImagickDraw();
$draw->rectangle( 0, 0, 200, 200 );
$draw->setFillPatternURL("/home/www/images/wood.jpg");
$im->drawImage($draw);


header( "Content-Type: image/png" );
echo $im;

?>

Re: Fill text with a pattern from an external image

Posted: 2008-03-31T05:49:01-07:00
by mkoppanen
Does not seem to be working here either (ImageMagick 6.4.0)