imageTranslate

Copies an image to a new location on the plane.

imageTranslate(name, xTrans, yTrans [, interpolation]) → returns void

Member Function Syntax

someImage.translate(xTrans, yTrans [, interpolation])

Argument Reference

name string
Required

The image on which this operation is performed.

xTrans numeric
Required

Displacement in the x direction.

yTrans numeric
Required

Displacement in the y direction.

interpolation string
Default: nearest

Type of interpolation
Values:
  • nearest : Applies the nearest neighbor method of interpolation. Image quality is lower than the other interpolation methods, but processing is fastest.
  • bilinear: Applies the bilinear method of interpolation. The quality of the image is less pixelated than the default, but processing is slower.
  • bicubic: Applies the bicubic method of interpolation. Generally, the quality of image is highest with this method and processing is slowest.

Examples
Sample code invoking the imageTranslate function

CF 11+ copy the original image to a new location on the plane

imgObj = imageNew("",152,152,"rgb","149c82");
imgObj.translate(35,35);
imgObj.drawRect(40,50,70,50,"yes");
cfimage(action="writeToBrowser", source=imgObj);

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub