DrawString Ant Task
This Ant task writes the specified text on the given BMP image.
Requires: Java 6.0 or higher
See also:
Download
Donate
Parameters
| Attribute | Description | Required |
| image | the BMP image to write on | Yes |
| toImage | the destination image | Yes |
| string | the text to write | Yes |
| x | the x coordinate of the location where the text should be written (0 is left) | No, defaults is 227 |
| y | the y coordinate of the location where the text should be written (0 is top) | No, defaults is 158 |
| r | the red component of the RGB color to use | No, defaults is 0 |
| g | the green component of the RGB color to use | No, defaults is 0 |
| b | the blue component of the RGB color to use | No, defaults is 0 |
| align | horizontal alignment; one of: left, center or right | No, defaults is center |
| scaleX | horizontal scale | No, defaults is 1.0 |
| scaleY | vertical scale | No, defaults is 1.0 |
| fontFamily | the font to use | No, defaults is SansSerif |
| fontHeight | the height of the font to use | No, defaults is 28 |
| bold | true if and only if to use bold font style | No, defaults is false |
| italic | true if and only if to use italic font style | No, defaults is false |
Example
<taskdef resource="drawstring.properties">
<classpath>
<fileset dir="lib" includes="*drawString*.jar"/>
</classpath>
</taskdef>
<drawString image="splash_template.bmp"
toImage="splash.bmp"
string="Hello Splash!"
r="255" g="255" b="255"/>
writes Hello Splash! in white on splash_template.bmp an saves the result as splash.bmp