Adobe ColdFusion 8

ImageRotateDrawingAxis

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(name, angle [, x, y])

See also

ImageRotate, ImageSetAntialiasing, ImageSetBackgroundColor, ImageSetDrawingColor, ImageSetDrawingStroke, ImageSetDrawingTransparency, ImageShearDrawingAxis, IsImageFile

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

name

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

<!--- This example shows to create an image with three shapes drawn on the same axis. --->
<!--- 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">