| Server IP : 23.254.227.96 / Your IP : 216.73.216.21 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/ImageMagick-perl/demo/ |
Upload File : |
#!/usr/bin/perl
# GD example using PerlMagick methods.
use Image::Magick;
#
# Create a 300x300 white canvas.
#
$image=Image::Magick->new;
$image->Set(size=>'300x300');
$image->Read('xc:white');
#
# Draw shapes.
#
$tile=Image::Magick->new;
$tile->Read('tile.gif');
$image->Draw(primitive=>'Polygon',tile=>$tile,fill=>'none',
points=>'30,30 100,10 190,290 30,290');
$image->Draw(stroke=>'red',primitive=>'Ellipse',stroke=>'black',fill=>'red',
strokewidth=>5,points=>'100,100 50,75 0,360');
$image->Draw(primitive=>'Polygon',fill=>'none',stroke=>'black',strokewidth=>5,
points=>'30,30 100,10 190,290 30,290');
$image->FloodfillPaint(geometry=>'+132+62',fill=>'blue',bordercolor=>'black',
invert=>'true');
#
# Draw text.
#
$image->Annotate(font=>'Generic.ttf',fill=>'red',geometry=>'+150+20',
pointsize=>18,text=>'Hello world!');
$image->Annotate(font=>'Generic.ttf',fill=>'blue',geometry=>'+150+38',
pointsize=>14,text=>'Goodbye cruel world!');
$image->Annotate(font=>'Generic.ttf',fill=>'black',geometry=>'+280+120',
pointsize=>14,text=>"I'm climbing the wall!",rotate=>90.0);
#
# Write image.
#
print "Write image...\n";
$image->Write('shapes.pam');
print "Display image...\n";
$image->Write(magick=>'SHOW',title=>"Shapes");