Skip to main content
Inspiring
April 27, 2011
Question

Tag or function text-to-image

  • April 27, 2011
  • 1 reply
  • 424 views

Is there in CF8 or CF9 a tag ot a function to transform a small text

into an image representing that same text.

Can be used for Emails display.

Thanks for answers.

Pierre.

This topic has been closed for replies.

1 reply

plartsAuthor
Inspiring
April 27, 2011

OK, I found myself the solution : using   imagenew, imagedrawtext, cfimage

<cfset myImage=ImageNew("",260,18,"argb","FFFFFF")>

<!--- Set the text attributes. --->
<cfset attr = StructNew()>
<cfset attr.underline = "no">
<cfset attr.size = 13>
<cfset attr.style = "bold">
<cfset attr.font = "verdana">
<cfset ImageSetDrawingColor(myImage,"2040a0")>
<!--- texte à écrire : text, à partir de X , à patir de Y, les attributs définis précédemment --->
<!--- <cfset ImageDrawText(myImage,email,5,18,attr)>  --->
<cfset ImageDrawText(myImage,email,1,15,attr)>

<cfimage source="#myImage#" action="writeToBrowser">