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
ParameterDescription
xCrop x coordinate.
yCrop y coordinate.
widthCrop width.
heightCrop height.
Example
image.crop(0, 0, 64, 64)
assert image.width == 64
assert image.height == 64