--- title: ImageData.height slug: Web/API/ImageData/height translation_of: Web/API/ImageData/height ---

{{APIRef("Canvas API")}}

只读的 ImageData.height 属性,返回在图像数据对象中的行的数量。

语法

imagedata.height

示例

var imagedata = new ImageData(100, 100);
imagedata.height; // 100

规范描述

Specification Status Comment
{{SpecName('HTML WHATWG', 'scripting.html#dom-imagedata-height', 'ImageData.height')}} {{Spec2('HTML WHATWG')}}  

浏览器兼容性

{{CompatibilityTable}}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{CompatGeckoDesktop("14")}} 9.0 9.0 3.1
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile("14")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}

参见