klyn.gui.images.RasterImage.crop
method

    public override crop(x as Int, y as Int, width as Int, height as Int) as Void:

Description

Selects a source rectangle and exposes it as the new logical image area.

The decoded pixel buffer is not rewritten. Rendering uses the selected source rectangle and scales it to the destination rectangle.

Parameters

Parameter | Description
--- | ---
`x` | Crop x coordinate.
`y` | Crop y coordinate.
`width` | Crop width.
`height` | Crop height.

Example

    image.crop(0, 0, 64, 64)
    assert image.width == 64
    assert image.height == 64