1 Reply Latest reply on Apr 27, 2011 8:47 AM by plarts

    Tag or function text-to-image

    plarts Level 1

      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.


        • 1. Re: Tag or function text-to-image
          plarts Level 1

          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">