Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

HTML canvas ImageData width Property

❮ HTML Canvas Reference

Example

Alert the width of an ImageData object:

alert("Width of imgData is: " + imgData.width);
Try it Yourself »

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
width Yes 9.0 Yes Yes Yes

Definition and Usage

The property returns the width of an ImageData object, in pixels.

Tip: Look at createImageData(), getImageData(), and putImageData() to learn more about the ImageData object.


JavaScript Syntax

JavaScript syntax: imgData.width;

❮ HTML Canvas Reference