Draw(tile=> ...) not implemented?

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Draw(tile=> ...) not implemented?

Post by rmabry »

The doc says tile=>image-handle is a parameter for Draw but I can't get it to work.

I can fill a polygon with a color:

Code: Select all

use Image::Magick;

my $image = new Image::Magick(size=>'300x300');
$image->Read('xc:transparent');

$image->Draw(primitive=>'polygon', points=>"100,50 100,200 200,150 200,100", fill=>'green');

$image->Write(filename=>'polyfill.png');
But I cannot fill (tile) the polygon with an image:

Code: Select all

use Image::Magick;

my $image = new Image::Magick(size=>'300x300');
$image->Read('xc:transparent');

$image->Draw(primitive=>'polygon', points=>"100,50 100,200 200,150 200,100", tile=>'mytile.png');

$image->Write(filename=>'polyfill.png');
Is that not the correct syntax? The following command-line versions both work fine:

Code: Select all

convert -size 300x300 xc:transparent -fill green -draw "polygon 100,50 100,200 200,150 200,100" mytry.png

convert -size 300x300 xc:transparent -tile mytile.png -draw "polygon 100,50 100,200 200,150 200,100" mytry.png
What's the problem?

Rick (running IM 6.3.0 on Win XP)

User avatar
magick
Site Admin
Posts: 11149
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

The tile parameter requires an image reference. You have an image filename.

User avatar
rmabry
Posts: 148
Joined: 2004-04-13T11:25:27-07:00

Post by rmabry »

magick wrote: The tile parameter requires an image reference. You have an image filename.


Doh! "The doc says tile=>image-handle", just like I said!

:oops:

But it's great - that makes it much more versatile than a filename, too.

Thanks,

Rick

Post Reply