ralphch has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to generate an image based on a text string with PerlMagick, but can't seem to get it working. This is to be used as a verification code for securing a web form. Here's the code:
#!/usr/bin/perl use Image::Magick; $image = Image::Magick->new; $image->Set(size=>'150x50'); $image->ReadImage('xc:white'); $text = "This is a test"; $image->Annotate(pointsize=>40, fill=>'red', text=>$text); print "Content-type: image/gif\n\n"; print $image->Write('gif:-');
Whenever I run the script through the browser, all I see are a couple of thin red lines (no text).
I've searched all over the Internet but can't seem to find any clear explanation on how to use this Annotate method.
Any help will be greatly appreciated.