Copies an image to a new location on the plane.
Nothing.
ImageTranslate(name
,xTrans
,yTrans
[,interpolation
])
ImageSetAntialiasing, ImageShear, ImageTranslateDrawingAxis, IsImageFile
ColdFusion 8: Added this function.
Parameter |
Description |
---|---|
name |
Required. The ColdFusion image on which this operation is performed. |
xTrans |
Required. Displacement in the x direction. |
yTrans |
Required. Displacement in the y direction. |
interpolation |
Optional. Type of interpolation used for resampling:
|
For each pixel (x, y) of the destination, the source value at the fractional subpixel position (x - xTrans, y - yTrans) is constructed by means of an interpolation object and written to the destination. If both xTrans and yTrans are integral, the operation wraps the source image to change the image's position in the coordinate plane.
Use the ImageSetAntialiasing function to improve the quality of the rendered image.
<!--- Create a ColdFusion image from an existing JPEG file. ---> <cfimage source="../cfdocs/images/artgallery/aiden01.jpg" name="myImage"> <!--- Turn on antialiasing to improve image quality. ---> <cfset ImageSetAntialiasing(myImage,"on")> <!--- Offset the image's position to (20,10). ---> <cfset ImageTranslate(myImage,20,10)> <!--- Display the offset image in a browser. ---> <cfimage source="#myImage#" action="writeToBrowser">