YouTip LogoYouTip

Prop Canvas Imagedata Width

HTML canvas ImageData width Property

HTML canvas ImageData width Property

Canvas Object Canvas Object

Example

Output the width of the ImageData object:

alert("Width of imgData is: " + imgData.width);

Try it yourself Β»


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The ImageData width property is supported in Internet Explorer 9, Firefox, Opera, Chrome, and Safari.

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: See also the createImageData(), getImageData(), and putImageData() methods for more information about ImageData objects.


JavaScript Syntax

JavaScript syntax: imgData.width;

Canvas Object Canvas Object

← Prop Canvas Imagedata HeightMet Canvas Drawimage β†’