createDrawImage

Creates an immutable source image for platform-neutral drawing.

The input array is copied before the image is returned, and every DrawImage.copyArgb call returns a fresh copy. The checked area is exactly size.width * size.height; zero-width or zero-height extents therefore require an empty array. Equal sizes and pixel values produce equal images with equal hash codes.

Return

an immutable, thread-safe image value.

Parameters

size

the non-negative source image extent.

argb

row-major straight, non-premultiplied 0xAARRGGBB pixels.

Throws

when the checked image area overflows Int.

when the pixel array length does not equal the checked image area.