makeSurface

fun makeSurface(imageInfo: ImageInfo): Surface?

Returns a compatible Surface, or null.

Returned Surface contains the same raster, GPU, or null properties as the original. Returned Surface does not share the same pixels.

Returns null if imageInfo width or height are zero, or if imageInfo is incompatible with Surface.

Return

compatible SkSurface or null

Parameters

imageInfo

contains width, height, AlphaType, ColorType, ColorSpace

See also


fun makeSurface(width: Int, height: Int): Surface?

Calls makeSurface(ImageInfo) with the same ImageInfo as this surface, but with the specified width and height.

Returned Surface contains the same raster, GPU, or null properties as the original. Returned Surface does not share the same pixels.

Returns null if imageInfo width or height are zero, or if imageInfo is incompatible with Surface.

Return

compatible SkSurface or null

Parameters

width

pixel column count; must be greater than zero

height

pixel row count; must be greater than zero