JavaScript canvas2d object method: putImageData()
[this page | pdf | back links]
The putImageData() method of the JavaScript
DOM object
returned by the getContext("2d")
method applied to the HTML <canvas>
element puts image data included in an ImageData object onto the canvas.
It has the following
syntax with the following parameters.
context.putImageData(ximgData, x, y,
drawnx,drawny, drawnwidth, drawnheight)
|
Parameter
|
Required / Optional
|
Description
|
|
imgData
|
Required
|
ImageData object to be
inserted back onto canvas
|
|
x
|
Required
|
x-coordinate of
upper-left corner of ImageData object
|
|
y
|
Required
|
y-coordinate of
upper-left corner of ImageData object
|
|
drawnx
|
Optional
|
x-coordinate of
upper-left corner of rectangle drawn onto canvas
|
|
drawny
|
Optional
|
x-coordinate of
upper-left corner of rectangle drawn onto canvas
|
|
drawnwidth
|
Optional
|
Width of rectangle, in
pixels, drawn onto canvas
|
|
drawnheight
|
Optional
|
Height of rectangle, in
pixels, drawn onto canvas
|
NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)