Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

getImageData method

Returns an ICanvasImageData object that represents the pixel data for the specified rectangle on a canvas. Use the data property to get a CanvasPixelArray to manipulate individual pixel data.

HTML Canvas 2D Context, Section 13Internet Explorer 9

Syntax


ICanvasImageData retVal = object.getImageData(sx, sy, sw, sh);

Parameters

sx [in]

Type: number

The x-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.

sy [in]

Type: number

The y-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.

sw [in]

Type: number

The width, in pixels, of the rectangle in relation to the coordinates of the canvas.

sh [in]

Type: number

The height, in pixels, of the rectangle in relation to the coordinates of the canvas.

Standards information

Remarks

If the rectangle contains pixels outside the canvas, they are returned as transparent black.

See also

CanvasPixelArray
ICanvasRenderingContext2D::putImageData
ICanvasImageData::data

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.