putImageData method

void putImageData(
  1. ImageData imagedata,
  2. int dx,
  3. int dy, [
  4. int dirtyX,
  5. int dirtyY,
  6. int dirtyWidth,
  7. int dirtyHeight,
])

The CanvasRenderingContext2D.putImageData() method of the Canvas 2D API paints data from the given ImageData object onto the canvas. If a dirty rectangle is provided, only the pixels from that rectangle are painted. This method is not affected by the canvas transformation matrix.

Note: Image data can be retrieved from a canvas using the CanvasRenderingContext2D.getImageData method.

You can find more information about putImageData() and general manipulation of canvas contents in the article Pixel manipulation with canvas.

Implementation

external void putImageData(
  ImageData imagedata,
  int dx,
  int dy, [
  int dirtyX,
  int dirtyY,
  int dirtyWidth,
  int dirtyHeight,
]);