allocN32Pixels

fun allocN32Pixels(width: Int, height: Int, opaque: Boolean = false): Boolean

Sets ImageInfo to width, height, and native color type; and allocates pixel memory. Sets ImageInfo to ColorAlphaType.PREMUL.

Calls reset() and returns false if width exceeds 29 bits or is negative, or height is negative.

Returns false if allocation fails.

Use to create Bitmap that matches the native pixel arrangement on the platform. Bitmap drawn to output device skips converting its pixel format.

Return

true if pixel storage is allocated

Parameters

width

pixel column count; must be zero or greater

height

pixel row count; must be zero or greater