The stupid question is the question not asked | |
PerlMonks |
Re: Re: Imager::Font examplesby domm (Chaplain) |
on Mar 04, 2003 at 07:41 UTC ( [id://240268]=note: print w/replies, xml ) | Need Help?? |
How would you determine the size of the image file automatically, if the font size was dynamic, without reserving a large image size? Hmm, never done that. One idea: Generate a very large image, draw the text, use $font->bounding_box to get the dimensions of the drawn string, and finally crop the image accordingly. How do I send the image to a web browser without saving the file first?
Try something like this:
Now you've got the image in $img_data, so you can print it to STDOUT (or via CGI). If operating under CGI, don't forget to set the proper content-type.
In Section
Seekers of Perl Wisdom
|
|