Draws a rectangle with rounded corners.
imageDrawRoundRect(name, x, y, width, height, arcwidth, archeight [, filled])
→ returns void
someImage.drawRoundRect(x, y, width, height, arcwidth, archeight [, filled])
false
This example shows how to draw a square with rounded corners.
<!--- Create a 200x200-pixel image. --->
<cfset myImage=imageNew("",200,200)>
<!--- Set the drawing color for the image to blue. --->
<cfset imageSetDrawingColor(myImage,"blue")>
<!--- Turn on antialiasing to improve image quality. --->
<cfset imageSetAntialiasing(myImage,"on")>
<!--- Draw a blue filled square with round corners of arcWidth=10 and arcHeight=2. --->
<cfset imageDrawRoundRect(myImage,5,5,190,190,"yes",10,2)>
<!--- Display the image in a browser. --->
<cfimage source="#myImage#" action="writeToBrowser">
CF 11+ Lucee 4.5+ Create a new image. With the new image draw filled rounded rectangle (width=70, height=50) starting at point (x=40,y=50)
imgObj = imageNew("",152,152,"rgb","149c82");
imgObj.drawRoundRect(40,50,70,50,35,35,"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.