ColdFusion 9.0 Resources |
ImageDrawOvalSee alsoImageDrawArc, ImageDrawCubicCurve, ImageDrawQuadraticCurve, ImageDrawRoundRect, ImageSetAntialiasing, ImageSetDrawingColor, ImageSetDrawingStroke, IsImageFile Parameters
UsageThe result is a circle or ellipse that fits within the rectangle specified by the x, y, width, and height arguments. If the filled parameter is set to yes, the area inside the oval is filled with the current drawing color. Use the ImageSetDrawingColor and ImageSetDrawingStroke functions to specify the color and line attributes of the oval. Use the ImageSetAntialiasing function to improve the quality of the rendered image. ExampleExample 1 <!--- This example shows how to draw a green filled oval. ---> <!--- Use the ImageNew function to create a 200x110-pixel image. ---> <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. ---> <cfimage source="#myImage#" action="writeToBrowser"> Example 2 <!--- This example shows how to draw a red circle with a line through it. ---> <!--- Use the ImageNew function to create a 201x201-pixel image. ---> <cfset myImage=ImageNew("",201,201)> <!--- Set the drawing color to red. ---> <cfset ImageSetDrawingColor(myImage,"red")> <!--- Turn on antialiasing to improve image quality. ---> <cfset ImageSetAntialiasing(myImage,"on")> <!--- Set the line width to 10 pixels. ---> <cfset attr=StructNew()> <cfset attr.width = 10> <cfset ImageSetDrawingStroke(myImage,attr)> <!--- Draw a diagonal line starting at (40,40) and ending at (165,165) on myImage. ---> <cfset ImageDrawLine(myImage,40,40,165,165)> <!--- Draw a circle starting at (5,5) and is 190 pixels high and 190 pixels wide. ---> <cfset ImageDrawOval(myImage,5,5,190,190)> <!--- Display the image in a browser. ---> <cfimage source="#myImage#" action="writeToBrowser"> |