imageDrawQuadraticCurve

Draws a curved line. The curve is controlled by a single point.

imageDrawQuadraticCurve(name, ctrlx1, ctrly1, x1, y1, x2, y2) → returns void

Member Function Syntax

someImage.drawQuadraticCurve(ctrlx1, ctrly1, x1, y1, x2, y2)

Argument Reference for the imageDrawQuadraticCurve function

name

Required: Yes
The image on which this operation is performed.

x1

Required: Yes
The x coordinate of the start point of the quadratic curve segment.

y1

Required: Yes
The y coordinate of the start point of the quadratic curve segment.

ctrlx1

Required: Yes
The x coordinate of the first control point of the quadratic curve segment.

ctrly1

Required: Yes
The y coordinate of the first control point of the quadratic curve segment.

x2

Required: Yes
The x coordinate of the end point of the quadratic curve segment.

y2

Required: Yes
The y coordinate of the end point of the quadratic curve segment.

Examples sample code invoking the imageDrawQuadraticCurve function


Tag Syntax

This example shows how to draw a curved line.OK

<!--- Use the imageNew function to create a 400x400-pixel image. ---> 
 <cfset myImage=imageNew("",400,400)> 
 <!--- Turn on antialiasing to improve image quality. ---> 
 <cfset imageSetAntialiasing(myImage,"on")> 
 <!--- Set the drawing color to green. ---> 
 <cfset imageSetDrawingColor(myImage,"green")> 
 <!--- Draw a curved line on the image. ---> 
 <cfset imageDrawQuadraticCurve(myImage,120,320,5,15,380,280)> 
 <!--- Display the image in a browser. ---> 
 <cfimage source="#myImage#" action="writeToBrowser">

Using drawQuadraticCurve member function

CF 11+ Lucee 4.5+ Create an new image. With the new image draw a cubic curve, starting at top left (0,0) ending at bottom right (152,152) with 1 control point at the bottom left (0,152)

imgObj = imageNew("",152,152,"rgb","149c82");
imgObj.drawQuadraticCurve(0,0,0,152,152,152);
cfimage (action="writeToBrowser", source=imgObj);

Fork me on GitHub