klyn.gui.images.Image.crop
method
public abstract crop(x as Int, y as Int, width as Int, height as Int) as Void
Description

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.

Parameters
ParameterDescription
xThe x-coordinate of the rectangle.
yThe y-coordinate of the rectangle.
widthThe width of the rectangle.
heightThe height of the rectangle.
Example
image = Image.getImage("image.bmp")
image.crop(0, 0, 100, 100)
assert image.width == 100
assert image.height == 100