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.
Syntax
ICanvasImageData retVal = object.getImageData(sx, sy, sw, sh);
Parameters
sx [in]
Type: numberThe x-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.
sy [in]
Type: numberThe y-coordinate, in pixels, of the upper-left corner of the rectangle in relation to the coordinates of the canvas.
sw [in]
Type: numberThe width, in pixels, of the rectangle in relation to the coordinates of the canvas.
sh [in]
Type: numberThe height, in pixels, of the rectangle in relation to the coordinates of the canvas.
Standards information
- HTML Canvas 2D Context, Section 13
Remarks
If the rectangle contains pixels outside the canvas, they are returned as transparent black.