Contents

createImageData

Creates an opaque object whose data property contains a one-dimensional array of pixel values, initialized to transparent black.

Declaration

ImageData createImageData(
    ImageData? imagedata
);

Parameters

  • sw:

    The width of the pixel array.

  • sh:

    The height of the pixel array.

Return Value

An imageData object.

Discussion

This method is typically used to create additional pixel arrays that can be blitted to the canvas in a single operation. You can optionally pass in another imageData object as a parameter, instead of a width and height, to create a new imageData object with the same pixel dimensions as the specified object.

See Also

Manipulating Pixels