THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML canvas ImageData width Property

Canvas Object Reference Canvas Object

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 4.0 9.0 3.6 4.0 10.1

Definition and Usage

The width 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;

Canvas Object Reference Canvas Object