The readonly ImageData.width
property returns the number of pixels per row in the ImageData
object.
Syntax
imageData.width
Example
This example creates an ImageData
object that is 200 pixels wide and 100 pixels tall. Thus, the width
property is 200
.
let imageData = new ImageData(200, 100);
console.log(imageData.width); // 200
Specification
Specification | Status | Comment |
HTML Living StandardThe definition of 'ImageData.width' in that specification. | Living Standard | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
width
|
Chrome
Full support Yes |
Edge
Full support 12 |
Firefox
Full support 14 |
IE
Full support 9 |
Opera
Full support 9 |
Safari
Full support 3.1 |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support 14 |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
See also
ImageData.width by Mozilla Contributors is licensed under CC-BY-SA 2.5.