ImageData

open external class ImageData(sw: Int, sh: Int, settings: ImageDataSettings = definedExternally) : ImageBitmapSource, TexImageSource, GPUCopyExternalImageSource(source)

The underlying pixel data of an area of a element. It is created using the ImageData() constructor or creator methods on the CanvasRenderingContext2D object associated with a canvas: createImageData() and getImageData(). It can also be used to set a part of the canvas by using putImageData().

MDN Reference

Constructors

Link copied to clipboard
constructor(data: Uint8ClampedArray<*>, sw: Int, sh: Int = definedExternally, settings: ImageDataSettings = definedExternally)
constructor(sw: Int, sh: Int, settings: ImageDataSettings = definedExternally)

Properties

Link copied to clipboard

Returns the one-dimensional array containing the data in RGBA order, as integers in the range 0 to 255.

Link copied to clipboard
val height: Int

Returns the actual dimensions of the data in the ImageData object, in pixels.

Link copied to clipboard
val width: Int

Returns the actual dimensions of the data in the ImageData object, in pixels.