ImageDrawQuadraticCurve

Description

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

Returns

Nothing.

Function syntax

ImageDrawQuadraticCurve(name, ctrlx1, ctrly1, ctrlx2, ctrly2, x1, y1, x2, y2)

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

name

Required. The ColdFusion image on which this operation is performed.

ctrlx1

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

ctrly1

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

ctrlx2

Required. The x coordinate of the second control point of the quadratic curve segment.

ctrly2

Required. The y coordinate of the second control point of the quadratic curve segment.

x1

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

y1

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

x2

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

y2

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

Usage

A quadratic curve is a curve controlled by a single control point. The curve is drawn from the last point in the shape to the target x and y coordinates. Coordinates can be integers or real numbers.

Use the ImageSetDrawingColor and ImageSetDrawingStroke functions to specify the color and lines of the quadratic curve. Use the ImageSetAntialiasing function to improve the quality of the rendered image.

Example

<!--- This example shows how to draw a curved line. ---> 
<!--- 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">