imageCopy

Copies a rectangular area of an image.

imageCopy(name, x, y, width, height [, dx] [, dy]) → returns Image

Member Function Syntax

someImage.copy(x, y, width, height [, dx] [, dy])

Argument Reference for the imageCopy function

name

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

x

Required: Yes
The x coordinate of the source rectangle.

y

Required: Yes
The y coordinate of the source rectangle.

width

Required: Yes
The width of the source rectangle.

height

Required: Yes
The height of the source rectangle.

dx

Required: No
The x coordinate of the destination rectangle.

dy

Required: No
The y coordinate of the destination rectangle.

Examples sample code invoking the imageCopy function


Using copy member function

CF 11+ Lucee 4.5+ Copy the center of the image, rotate it 180 degrees about its center and paste it back into the original image

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
copiedImgObj = imgObj.copy(50,50,50,50);
copiedImgObj.rotate(25,25,180,"bicubic");
imgObj.paste(copiedImgObj,50,50);
cfimage(action="writeToBrowser", source=imgObj);

Fork me on GitHub