Description

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

Returns

Nothing

Category

ImageDrawQuadraticCurve(name, x1, y1, ctrlx, ctrly, x2, y2)

History

ColdFusion 8: Added this function.

See also

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

name

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

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.

ctrlx

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

ctrly

Required. The y coordinate of the control 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">
<cfscript>
       myImage=ImageNew("",800,400); // Create an 800x400 image
       ImageSetAntialiasing(myImage,"on"); // Turn on antialiasing to improve image quality
       ImageSetDrawingColor(myImage,"green"); // Set the drawing color to green
       ImageDrawQuadraticCurve(myImage,120,300,200,125,380,280); // Draw a curved line on the image
       ImageWrite(myImage,"QuadraticCurve.png"); // Write the image to a file
</cfscript>

Output

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy