Shears an image either horizontally or vertically. For each pixel (x, y) of the destination, the source value at the fractional subpixel position (x', y') is constructed by means of an Interpolation object and written to the destination.
Nothing.
ImageShear(name
,shear
[,direction
,interpolation
])
ImageSetAntialiasing, ImageShearDrawingAxis, IsImageFile
ColdFusion 8: Added this function.
Parameter |
Description |
---|---|
name |
Required. The ColdFusion image on which this operation is performed. |
shear |
Required. Shear value. Coordinates can be integers or real numbers. |
direction |
Optional. Shear direction:
|
interpolation |
Optional. Type of interpolation:
|
Use this function to distort an image.
If the direction parameter is set to horizontal, x' = (x - y*shear) and y' = y.
If the direction parameter is set to vertical, x' = x and y' = (y - x*shear).
Use the ImageSetAntialiasing function to improve the quality of the rendered image.
<!--- This example shows how to shear an image. ---> <!--- 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")> <!--- Shear the image by a factor of 1 on a horizontal axis. ---> <cfset ImageShear(myImage,1,"horizontal")> <!--- Display the image in a browser. ---> <cfimage source="#myImage#" action="writeToBrowser">