cropped

fun KiteBitmap.cropped(x: Int, y: Int, width: Int, height: Int): KiteBitmap(source)

Return the width×height region whose top-left corner is (x, y). A full-size rectangle returns this bitmap and shares its pixel array; every smaller rectangle allocates and copies the selected pixels.

Throws

if the rectangle is empty or reaches outside the bitmap: silently clamping a bad crop hides the caller's bug.


fun KiteAnimation.cropped(x: Int, y: Int, width: Int, height: Int): KiteAnimation(source)

cropped applied to every frame, preserving delays and loop count.

Throws

if the rectangle is empty or outside a frame