Window screen.pixelDepth attribute
- Προηγούμενη σελίδα Υψος
- Επόμενη σελίδα Πλάτος
- Επιστροφή στο προηγούμενο επίπεδο Window Screen
Definition and usage
pixelDepth
The property returns the color depth of the screen.
pixelDepth
The property returns the color depth in units of bits per pixel.
pixelDepth
The property is read-only.
See also:
screen.colorDepth attribute
Tip:
Internet Explorer 9 and earlier versions do not support pixelDepth
property.
butpixelDepth
and colorDepth
Returns the same value.
Since all browsers support colorDepth
Please use this property instead.
Instance
Example 1
Get the screen's color resolution:
let depth = screen.pixelDepth;
Example 2
All screen attributes:
let text = "Total width/height: " + screen.width + "*" + screen.height + "<br>" "Available width/height: " + screen.availWidth + "*" + screen.availHeight + "<br>" "Color depth: " + screen.colorDepth + "<br>" "Color resolution: " + screen.pixelDepth;
Syntax
screen.pixelDepth
Return value
Type | Description |
---|---|
Number |
Color resolution per pixel bit: 1, 4, 8, 15, 16, 24, 32, or 48. |
Browser support
All browsers support screen.pixelDepth
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Supports | Supports | Supports | Supports | Supports | Supports |
Related pages
- Προηγούμενη σελίδα Υψος
- Επόμενη σελίδα Πλάτος
- Επιστροφή στο προηγούμενο επίπεδο Window Screen