Lives On Board

/ My MetaSphere /

Wed Dec 3, 2003

Flash MX Hosting
Web Hosting
Web Tools
Help FAQ
Site Chat
Web Search
Asheville NC
Network Log
Got Flash?
Web Links

Need Help?
We are online if image is green.
We are online if this image is green. Click here to chat live with

We are proud to host Acoustic Syndicate.

Flash Hosting with MetaSphere

Today in History:
1818: Illinois entered the Union as the 21st state.
Asheville, NC
Help/FAQ Index / Search
Previous Page in Help/FAQ Tour Next Page in Help/FAQ Tour
Return to Main Page in Help/FAQ

Hello World ImageMagick Draw Command

Output from helloworld.cgi using imagemagick to read an image called "map.gif" and draw rectangles and circles on top of the map image. Finally outputs the image to a browser with the proper content-type for a gif file. Download the Map here.

Perl Source Code:

binmode STDOUT;
print "Content-type: image/gif\n\n";
use Image::Magick;
my(, );
 = Image::Magick->new;
->Draw(primitive=>'FillRectangle',points=>"10,10 60,80",pen=>'#FFFF00');
->Draw(primitive=>'Rectangle',points=>"10,10 190,190",pen=>"blue",linewidth=>2);
->Draw(primitive=>'Rectangle',points=>"44,44 122,122",pen=>"blue",linewidth=>1);
->Draw(primitive=>'Circle',points=>"50,50 45,32",pen=>"green",linewidth=>5);
->Draw(primitive=>'Rectangle',points=>"14,14 187,187",pen=>"white",linewidth=>2);
->Draw(primitive=>'Rectangle',points=>"26,24 187,187",pen=>'#AAAA00',linewidth=>4);
->Draw(primitive=>'FillRectangle',points=>"110,112 135,136",pen=>"white",linewidth=>1);
undef ;

And here's another simple ImageMagick script which resizes an image nnn.jpg. This is written in Perl and runs on our server.

use Image::Magick;
my(, );
 = Image::Magick->new;
print "Content-type: image/jpeg\n\n";
binmode STDOUT;
undef ;

Here's the code working.

Refresh / Add Page to favorites/bookmarks.