makeRaster

fun makeRaster(imageInfo: ImageInfo): Surface

Allocates raster Surface. Canvas returned by Surface draws directly into pixels. Allocates and zeroes pixel memory. Pixel memory size is imageInfo.height() times imageInfo.minRowBytes(). Pixel memory is deleted when Surface is deleted.

Surface is returned if all parameters are valid. Valid parameters include:

  • info dimensions are greater than zero;

  • info contains ColorType and AlphaType supported by raster surface;

Return

new Surface

Parameters

imageInfo

width, height, ColorType, AlphaType, ColorSpace, of raster surface; width and height must be greater than zero


fun makeRaster(imageInfo: ImageInfo, rowBytes: Int): Surface

Allocates raster Surface. Canvas returned by Surface draws directly into pixels. Allocates and zeroes pixel memory. Pixel memory size is imageInfo.height() times rowBytes, or times imageInfo.minRowBytes() if rowBytes is zero. Pixel memory is deleted when Surface is deleted.

Surface is returned if all parameters are valid. Valid parameters include:

  • info dimensions are greater than zero;

  • info contains ColorType and AlphaType supported by raster surface;

  • rowBytes is large enough to contain info width pixels of ColorType, or is zero.

If rowBytes is zero, a suitable value will be chosen internally.

Return

new Surface

Parameters

imageInfo

width, height, ColorType, AlphaType, ColorSpace, of raster surface; width and height must be greater than zero

rowBytes

interval from one Surface row to the next; may be zero


fun makeRaster(imageInfo: ImageInfo, rowBytes: Int, surfaceProps: SurfaceProps?): Surface

Allocates raster Surface. Canvas returned by Surface draws directly into pixels. Allocates and zeroes pixel memory. Pixel memory size is imageInfo.height() times rowBytes, or times imageInfo.minRowBytes() if rowBytes is zero. Pixel memory is deleted when Surface is deleted.

Surface is returned if all parameters are valid. Valid parameters include:

  • info dimensions are greater than zero;

  • info contains ColorType and AlphaType supported by raster surface;

  • rowBytes is large enough to contain info width pixels of ColorType, or is zero.

If rowBytes is zero, a suitable value will be chosen internally.

Return

new Surface

Parameters

imageInfo

width, height, ColorType, AlphaType, ColorSpace, of raster surface; width and height must be greater than zero

rowBytes

interval from one Surface row to the next; may be zero

surfaceProps

LCD striping orientation and setting for device independent fonts; may be null