roundedCorners

fun Bitmap.roundedCorners(radiusPx: Float, targetSize: PixelSize = PixelSize(width, height), antiAlias: Boolean = false): Bitmap(source)

Returns a copy of this bitmap clipped to rounded corners and optionally resized to targetSize.

The default keeps the original Onyx SDK's non-antialiased mask. Set antiAlias to true to opt into smoother, partially transparent edge pixels.

Throws

when radiusPx is negative or non-finite, or when targetSize is empty