Page 1 of 1

Draw circle, rectangle, polyline

Posted: 2007-06-08T10:45:20-07:00
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.

Re: Draw circle, rectangle, polyline

Posted: 2007-06-08T11:10:52-07:00
by magick
Add
  • fill=>'none'
to your Draw() method to prevent your poly from being filled. By default it fills interior spaces with black.