imageShearDrawingAxis

Description

Shears the drawing canvas.

Categories

Related

History

ColdFusion 8: Added this function.

Syntax

ImageShearDrawingAxis(name, shx, shy)

Attributes

AttributeDescriptionRequiredDefault
nameRequired. The ColdFusion image on which this operation is performed.
shxRequired. The multiplier by which coordinates are shifted in the positive x axis direction as a function of the y coordinate.
shyRequired. the multiplier by which coordinates are shifted in the positive y axis direction as a function of the x coordinate.

Returns

Nothing.

Usage

For each pixel (x,y) of the destination, the source value at the fractional subpixel position (x',y') is constructed with an interpolation object and written to the destination.
If the direction parameter is equal to horizontal,x' = (x - y*shear) and y' = y.
If the direction parameter is equal to vertical,x' = x and y' = (y - x*shear).
Use the ImageSetAntialiasing function to improve the quality of the rendered image.

Example

<!--- Create a ColdFusion image from an existing JPEG file. ---> 
<cfimage source="../cfdocs/images/artgallery/paul03.jpg" name="myImage"> 
<!--- Turn on antialiasing to improve image quality. ---> 
<cfset ImageSetAntialiasing(myImage,"on")> 
<!--- Set the shear drawing axis. ---> 
<cfset ImageShearDrawingAxis(myImage,0.5,0.5)> 
<!--- Draw a rectangle on the image with the shear settings. ---> 
<cfset ImageDrawRect(myImage,50,50,50,50)> 
<!--- Display the image in a browser. ---> 
<cfimage source="#myImage#" action="writeToBrowser">