ralphch has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
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.
Thanks,
Ralph
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Generating text as an image with PerlMagick
by themage (Friar) on Nov 30, 2006 at 14:53 UTC | |
Re: Generating text as an image with PerlMagick
by Fengor (Pilgrim) on Nov 30, 2006 at 15:03 UTC | |
Re: Generating text as an image with PerlMagick
by derby (Abbot) on Nov 30, 2006 at 14:52 UTC | |
Re: Generating text as an image with PerlMagick
by GrandFather (Saint) on Nov 30, 2006 at 20:45 UTC | |
by Fengor (Pilgrim) on Nov 30, 2006 at 22:40 UTC | |
Re: Generating text as an image with PerlMagick
by ralphch (Sexton) on Nov 30, 2006 at 23:10 UTC |
Back to
Seekers of Perl Wisdom