klyn.gui.images.Image.crop
method
public method crop(x as Int, y as Int, width as Int, height as Int) as Void:
Description
Crops the image to the specified rectangle.
image = new Image()
image.load("image.png")
image.crop(0, 0, 100, 100)
Parameters
  • 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 = new Image() image.load("image.png") image.crop(0, 0, 100, 100) ```