HTML canvas ImageData widthAttributes
Examples
Output the width of the ImageData object:
alert("Width of imgData is: " + imgData.width);
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
Internet Explorer 9, Firefox, Opera, Chrome, and Safari support the ImageData width property.
Note:Internet Explorer 8 and earlier versions do not support the <canvas> element.
Definition and Usage
The width property returns the width of the ImageData object, in pixels.
Tip:Please refer to thecreateImageData()、 getImageData()andputImageData()method for more knowledge about the ImageData object.
JavaScript Syntax
| JavaScript syntax: | imgData.width; |
|---|
HTML canvas Reference Manual Other Extensions