MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 216.73.216.194
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/doc/ImageMagick-perl-6.9.10.68/demo/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/doc/ImageMagick-perl-6.9.10.68/demo/shapes.pl
#!/usr/bin/perl

eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell
# 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(fill=>'red',geometry=>'+150+20',pointsize=>18,
  text=>'Hello world!');
$image->Annotate(fill=>'blue',geometry=>'+150+38',pointsize=>14,
  text=>'Goodbye cruel world!');
$image->Annotate(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.gif');
print "Display image...\n";
$image->Write('win:');

MMCT - 2023