Draw circle, rectangle, polyline

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
abjones
Posts: 33
Joined: 2004-03-26T12:21:59-07:00

Draw circle, rectangle, polyline

Post by abjones »

Using ImageMagick-6.3.4-6-Q8-windows-dll.exe
draw primitive=>'polyline' fills the interior as if a solid polygon;
do I need additional parameters?

Code: Select all

use Image::Magick;
$image=Image::Magick->new;
$error=$image->Set(size=>'200x200');
$error=$image->Draw( primitive=>'polyline', stroke=>'red', 
                               points=>'20,20 20,100 100,100', strokewidth=>5 );
@blobs = $image->ImageToBlob(magick=>'png');
binmode STDOUT;
print "Content-type: image/png\n";
print "\n";
print  $blobs[0];
results in red line on two sides of a black triangle unlike behavior using version ImageMagick-6.2.9-7-Q8-windows-dll.exe;

using version 6.3.4-6 Rectangle and Circle also fill the interior when no fill=> parameter is given unlike version 6.2.9-7 which does not fill.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Draw circle, rectangle, polyline

Post by magick »

Add
  • fill=>'none'
to your Draw() method to prevent your poly from being filled. By default it fills interior spaces with black.
Post Reply