Hello, all,
I've been playing around with imageDrawLine(s) and imageDrawText (only just recently discovered them), and I am confused about something that I hope someone can help clarify.
If I create a new image using imageNew, I can draw lines and text on it with no problems.
However, if I use CFIMAGE or imageNew to create an image from an existing .gif, it will not work. It does not error - it just leaves a blank white space where the image should be.
Is it not possible to add lines or text to existing images?? Here's my code, so far:
<cfimage action="read" source="#app_root#img/500x500.gif" name="myImage" /><cfset imageSetAntiAliasing(myImage,'on') /><cfset imageSetDrawingColor(myImage,'black') /><cfset attr = StructNew() /><cfset attr.width = 5 /><cfset attr.endcaps = "round" /><cfset imageSetDrawingStroke(myImage,attr) /> ... set x/y arrays ...<cfset imageDrawLInes(myImage,x,y,true,false) /><cfimage action="writetobrowser" source="#myImage#" format="png" />
As the code above is, this gives me a blank square 500 x 500. No lines. No text, if I use the imageDrawText tag.
If I change line 01 to <cfset myImage = imageNew('','500','500','rgb','white') />, then it gives me a white square with the lines drawn as I coded for.
What I am doing incorrectly? Or does it not work with existing images?
V/r,
^_^