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

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.

Example

    image = Image.getImage("image.bmp")
    image.crop(0, 0, 100, 100)
    assert image.width == 100
    assert image.height == 100