ImageTranslateDrawingAxis

Description

Translates the origin of the image context to the point (x,y) in the current coordinate system. Modifies the image context so that its new origin corresponds to the point (x,y) in the image’s original coordinate system.

Returns

Nothing.

Function syntax

ImageTranslateDrawingAxis(name, x, y)

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

name

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

x

x coordinate

y

y coordinate

Usage

All coordinates used in subsequent rendering operations on this image context are relative to the new origin. Use the ImageSetAntialiasing function to improve the quality of the rendered image.

Example

<!--- Create a 200x200-pixel image. ---> 
<cfset myImage=ImageNew("",200,200)> 
<!--- Turn on antialiasing to improve image quality. ---> 
<cfset ImageSetAntialiasing(myImage)> 
<!--- Translate the origin to (100,20). ---> 
<cfset ImageTranslateDrawingAxis(myImage,100,20)> 
<!--- Draw a rectangle at the offset location. ---> 
<cfset ImageDrawRect(myImage,50,60,40,50)> 
<!--- Display the image in a browser. ---> 
<cfimage source="#myImage#" action="writeToBrowser">