public abstract crop(x as Int, y as Int, width as Int, height as Int) as Void
Crops the logical image area.
After a successful crop, width and height report the cropped size. Raster images render the selected source rectangle. SVG images update the logical viewBox to the selected rectangle.
| Parameter | Description |
|---|---|
x | The x-coordinate of the rectangle. |
y | The y-coordinate of the rectangle. |
width | The width of the rectangle. |
height | The height of the rectangle. |
image = Image.getImage("image.bmp")
image.crop(0, 0, 100, 100)
assert image.width == 100
assert image.height == 100