How to draw a text string on a ColdFusion image

ImageDrawText() - draw a text string on a coldfusion image

ImageDrawText.cfm



<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ImageDrawText function example: how to draw a text string on a coldfusion image</title>
</head>

<body>
<h2 style="color:Crimson">ImageDrawText Function Example</h2>

<cfset TestImage=ImageNew("",200,200)>
<cfset ImageSetDrawingColor(TestImage,"red")>
<cfset ImageSetAntialiasing(TestImage,"on")>
<cfset ImageDrawText(TestImage,"Sowa Chan Pakhi",25,25)>
<cfimage action="writeToBrowser" source="#TestImage#">
</body>
</html>