Description
Creates an image and sets a transparent color.
Returns
Image object
imageMakeColorTransparent(img, color__)
ColdFusion 10: Added this function
Parameter |
Description |
---|---|
img |
Required. The ColdFusion image on which this operation is performed. |
color |
Required. The transparent color:
|
<cfset myImage=ImageNew("",200,110)> <!--- Set the drawing color to green. ---> <cfset ImageSetDrawingColor(myImage,"green")> <!--- Turn on antialiasing to improve image quality. ---> <cfset ImageSetAntialiasing(myImage,"on")> <!--- Draw a filled green oval on the image. ---> <cfset ImageDrawOval(myImage,5,5,190,100,"yes")> <!--- Display the image in a browser. ---> <cfoutput>PNG image<br></cfoutput> <cfset ImageWrite(myImage,"#expandpath('.')#/png.png")> <cfset myImage = ImageRead("#expandpath('.')#/png.png")> <cfimage source="#myImage#" action="writeToBrowser" > <cfset x =ImageMakeColorTransparent(myImage,"green")> <cfimage source="#x#" action="writeToBrowser" >