ImageDrawText()
Draws a text string on an image with the baseline of the first character positioned at (x,y) in the image.
Requires Extension: Image Extension for Jakarta EE (Lucee 7+)
ImageDrawText( image=any, string=string, x=number, y=number, attributeCollection=struct );
Returns: void
| Argument | Description |
|---|---|
|
image
any,
required
|
edit
The image on which this operation is performed. Alias: name |
|
string
string,
required
|
edit
the text to draw. Alias: str |
|
x
number,
required
|
edit
The x coordinate for the start point of the string. |
|
y
number,
required
|
edit
The y coordinate for the start point of the string. |
|
attributeCollection
struct,
optional
|
edit
a structure used to specify the text characteristics. the following keys are supported:
|
Examples
editimg=imageNew("",300,300,"RGB","45aaf2");
style={size="26",style="Italic"};
ImageDrawText(img,"I love lucee",75,120,style);
cfimage(action="writeToBrowser",source=img);
See also
- Image manipulation
- image.drawText()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)