Annotate changed the image in no way, the only change was the image extension into a new .png file. The size of the test image is 500x75.
My attempt at imDisplay "test.png"; resulted in "Syntax error at line 25 near "imDisplay = "test.png";, Execution of..aborted.. | [reply] [d/l] |
XX
XX
XX
XXXXXXX
^
^
The origin of the TTF font character is left bottom, your drawing routine assumes Y=0, which means the font is drawn off the image. Give it a positive Y value, say 40.
Also you need to specify the fullpath to the TTF font. Annotate will not draw the text if the font file does not exist. Do you have Chinese fonts installed on your system? That 'kai.ttf' is a Chinese font which I think might not exist on your computer. ;-)
If you want to display the image with imDisplay, add the following to the end of your script:
system("imDisplay test.png");
| [reply] [d/l] [select] |
Okay, I tried using $image->Annotate(font=>'kai.ttf', pointsize=>40, fill=>'green', text=>$text, y=>'40'); Is that what you meant? It's still not doing anything so it probably can't find the font. Is there a way I can leave the font face off and have it use a default font?
Thanks
| [reply] [d/l] |