HTML canvas ImageData width attribute
Example
Output the width of the ImageData object:
alert("Width of imgData is: " + imgData.width);
Try it »
Browser support





Internet Explorer 9, Firefox, Opera, Chrome and Safari support the ImageData width attribute.
**Note:** Internet Explorer 8 and earlier versions do not support
Definition and Usage
The width attribute returns the width of the ImageData object, in pixels.
**Tip:** See the createImageData(), getImageData() and putImageData() method, for more information about the ImageData object.
JavaScript syntax
| JavaScript syntax: | imgData.width; |
|---|
HTML canvas Reference Manual