ColdFusion 9.0 Resources |
ImageSetDrawingColorDescriptionSets the current drawing color for ColdFusion images. All subsequent graphics operations use the specified color. See alsoImageSetAntialiasing, ImageSetBackgroundColor, ImageSetDrawingStroke, ImageSetDrawingTransparency, IsImageFile Parameters
UsageUse the ImageSetDrawingColor function to control the color of all subsequent drawing objects in ColdFusion images. For example, you can use this function to set the drawing color to red once, and then draw a circle, a square, and 10 lines in that color. If the color value is a string, specify a supported named color; see the list of valid HTML named colors in cfimage. For a hexadecimal value, use the form "##xxxxxx" or "xxxxxx", where x = 0-9 or A-F; use two number signs or none. Example<!--- This example shows how to set the drawing color and draw several objects in that color. ---> <!--- Use the ImageNew function to create a ColdFusion image. ---> <cfset myImage=ImageNew("",200,300)> <!--- Turn on antialiasing to improve image quality. ---> <cfset ImageSetAntialiasing(myImage)> <!--- Set the drawing color to pink. ---> <cfset ImageSetDrawingColor(myImage,"pink")> <!--- Draw a pink line. ---> <cfset ImageDrawLine(myImage,1,1,200,300)> <!--- Draw a pink oval. ---> <cfset ImageDrawOval(myImage,40,50,80,40)> <!--- Draw another pink oval. ---> <cfset ImageDrawOval(myImage,15,180,80,40)> <!--- Draw a pink rectangle. ---> <cfset ImageDrawRect(myImage,100,100,45,65)> <!--- Display the image in a browser. ---> <cfimage source="#myImage#" action="writeToBrowser"> |