imageCopy

Copies a rectangular area of an image.

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

Member Function Syntax

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

Argument Reference

name string
Required

The ColdFusion image on which this operation is performed.

x numeric
Required

The x coordinate of the source rectangle.

y numeric
Required

The y coordinate of the source rectangle.

width numeric
Required

The width of the source rectangle.

height numeric
Required

The height of the source rectangle.

dx numeric

The x coordinate of the destination rectangle.

dy numeric

The y coordinate of the destination rectangle.

Examples
Sample code invoking the imageCopy 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);

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

Fork me on GitHub