imageDrawArc

Draws a circular or elliptical arc.

imageDrawArc(name, x, y, width, height, startAngle, archAngle [, filled]) → returns void

Member Function Syntax

someImage.drawArc(x, y, width, height, startAngle, archAngle [, filled])

Argument Reference

name string
Required

The image on which this operation is performed.

x numeric
Required

The x coordinate of the upper-left corner of the arc.

y numeric
Required

The y coordinate of the upper-left corner of the arc.

width numeric
Required

The width of the arc.

height numeric
Required

The height of the arc.

startAngle numeric
Required

The beginning angle in degrees.

archAngle numeric
Required

The angular extent of the arc, relative to the start angle.

filled boolean
Default: false

Specify whether the arc is filled
Values:
  • true
  • false

Examples
Sample code invoking the imageDrawArc function

This example shows how to use the imageNew function to create a blank ColdFusion image that is 250 pixels wide and 180 pixels high.

<cfset myImage=imageNew("",250,320)> 
 <!--- Set the drawing color for the arc to orange. --->  
 <cfset imageSetDrawingColor(myImage,"orange")> 
 <!--- Turn on antialiasing to improve image quality. --->  
 <cfset imageSetAntialiasing(myImage,"on")> 
 <!--- Draw an enclosed orange arc starting at the coordinate (5,5). --->  
 <cfset imageDrawArc(myImage,5,5,200,300,100,100,"yes")> 
 <!--- Display the image in a browser. --->  
 <cfimage action="writeToBrowser" source="#myImage#">  

CF 11+ Lucee 4.5+ Draw a circle in the center of the image and fill with color

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.setDrawingColor("005100");
imgObj.drawArc(50,50,50,50,90,360,"yes");
cfimage(action="writeToBrowser", source=imgObj);

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub