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])

imageCopy Argument Reference

name
Required

The ColdFusion image on which this operation is performed.

x
Required

The x coordinate of the source rectangle.

y
Required

The y coordinate of the source rectangle.

width
Required

The width of the source rectangle.

height
Required

The height of the source rectangle.

dx

The x coordinate of the destination rectangle.

dy

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