Whatever message this page gives is out now! Go check it out!

ImageRotateDrawingAxis

Last update:
May 18, 2026

Description

Rotates all subsequent drawing on a ColdFusion image at a specified point by a specified angle.

Returns

A ColdFusion image.

Category

Function syntax

ImageRotateDrawingAxis(image, angle [, x, y])

See also

History

ColdFusion (2018 release): Introduced named parameters.
ColdFusion 8: Added this function.

Parameters

Parameter
Description
image
Required. The ColdFusion image on which this operation is performed.
angle
Required. The rotation angle in degrees.
x
Optional. The x coordinate for the point of rotation. The default value is 0.
y
Optional. The y coordinate for the point of rotation. The default value is 0.

Usage

The default position of the origin is 0,0. To revert to the original drawing axis, call the same (x,y) parameters with the negative of the original angle. Use the ImageSetAntialiasing function to improve the quality of the rendered image.

Example

<!--- Use ImageNew to create a 300x300-pixel image. --->
<cfset myImage=ImageNew("",300,300)>
<!--- Turn on antialiasing to improve image quality. --->
<cfset ImageSetAntialiasing(myImage,"on")>
<!--- Set the drawing axis to 30 degrees and the point of rotation at (10,10). --->
<cfset ImageRotateDrawingAxis(myImage,30,10,10)>
<!--- Set the drawing color to blue. --->
<cfset ImageSetDrawingColor(myImage,"blue")>
<!--- Draw three shapes with the same color and drawing axis. --->
<cfset ImageDrawRect(myImage,150,10,10,150,"yes")>
<cfset ImageDrawOval(myImage,200,40,45,65,"yes")>
<cfset ImageDrawRect(myImage,275,10,10,150,"yes")>
<cfimage source="#myImage#" action="writeToBrowser">

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page