Description

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

Returns

A ColdFusion image.

Category

Image functions

Function syntax

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

See also

ImageRotateImageSetAntialiasingImageSetBackgroundColorImageSetDrawingColorImageSetDrawingStroke
ImageSetDrawingTransparencyImageShearDrawingAxisIsImageFile

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">

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