Canvas height attribute

Definition and Usage

height This property returns the height of the ImageData object in pixels.

Tip:See Also createImageData(),getImageData() and putImageData() Methods, to learn more about ImageData objects.

Example

Output the height of ImageData object:

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

Try It Yourself

Syntax

imgData.height;

Technical Details

Default Value: #000000

Browser Support

The numbers in the table indicate the first browser version to fully support this attribute.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
4.0 9.0 3.6 4.0 10.1

Note:Internet Explorer 8 and earlier versions do not support the <canvas> element.