crop

Trims an image.

# Metadata

Platforms: desktop, server, mobile OS: mac, windows, linux Introduced: 2.0 Security:

# Syntax

crop image to left, top, right, bottom

# Params

- image : Any image reference. - left : The left, top, right, and bottom describe the new rectangle of the image. - top : - right : - bottom :

# Examples

crop image 1 to 100,100,200,200

crop image "photo" to the rect of graphic "Overlay"

# Description

Use the crop command to remove parts of an image, or to extend the image's edges.

The crop command changes the image rectangle property to the new rectangle. Unlike changing the rectangle directly, the crop command removes image data outside the new rectangle, instead of scaling the image to fit.

If the crop rectangle is smaller than the image original rectangle, the parts of the image outside the crop rectangle are removed. This is a permanent operation; the cropped portions do not reappear if you use the crop command to change the image rectangle back to the original size.

If the crop rectangle is larger than the image original rectangle, blank pixels are added to one or more edges of the image.

>*Important:* The crop command cannot be used on a > referenced control. Doing so will cause an > execution error.

# Tags

ui,

# See

- **keyword:** image, rectangle - **property:** pixels, imageData, rectangle - **command:** flip, rotate - **object:** image - **glossary:** property, referenced control, command, execution error