ImageCrop()
Crops an image to a specified rectangular area.
Requires Extension: Image Extension for Jakarta EE (Lucee 7+)
ImageCrop( image=any, x=number, y=number, width=number, height=number );
Returns: void
| Argument | Description |
|---|---|
|
image
any,
required
|
edit
The image on which this operation is performed. Alias: name |
|
x
number,
required
|
edit
The X origin of the crop area. |
|
y
number,
required
|
edit
The Y origin of the crop area. |
|
width
number,
required
|
edit
The width of the crop area. |
|
height
number,
required
|
edit
The height of the crop area. |
Examples
editimg=imageRead("https://avatars1.githubusercontent.com/u/10973141?s=280&v=4")
imageCrop(img,50,10,100,100);
cfimage(action="writeToBrowser", source=img);
See also
- Image manipulation
- image.crop()
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)