--- title: ImageData.width slug: Web/API/ImageData/width translation_of: Web/API/ImageData/width ---
{{APIRef("Canvas API")}}
只读的 ImageData.width
属性,返回在图像数据对象中每一行像素的数量。
imagedata.width
var imagedata = new ImageData(100, 100); imagedata.width // 100
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'scripting.html#dom-imagedata-width', 'ImageData.width')}} | {{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}} |