Window screen.pixelDepth 属性
- ກັບຄືນລະດັບກ່ວານີ້ height
- ອີກກັບໜ້າຫນື່ງ width
- ກັບຄືນລະດັບກ່ວານີ້ Screen Window
定义和用法
pixelDepth
属性返回屏幕的颜色深度。
pixelDepth
属性返回以每像素位数为单位的颜色深度。
pixelDepth
属性是只读的。
另请参阅:
screen.colorDepth 属性
提示:
Internet Explorer 9 及更早版本不支持 pixelDepth
属性。
但是,pixelDepth
和 colorDepth
返回相同的值。
由于所有浏览器都支持 colorDepth
,请改用该属性。
实例
例子 1
获取屏幕的颜色分辨率:
let depth = screen.pixelDepth;
例子 2
所有屏幕属性:
let text = "Total width/height: " + screen.width + "*" + screen.height + "
" + "Available width/height: " + screen.availWidth + "*" + screen.availHeight + "
" + "Color depth: " + screen.colorDepth + "
" + "Color resolution: " + screen.pixelDepth;
语法
screen.pixelDepth
返回值
类型 | 描述 |
---|---|
数字 |
每像素位的颜色分辨率: 1, 4, 8, 15, 16, 24, 32, ຫຼື 48。 |
ສະໜັບສະໜູນບັນດາບັນນາທິການ
ທຸກບັນດາບັນນາທິການກະຈາຍ screen.pixelDepth
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
ສະໜັບສະໜູນ | ສະໜັບສະໜູນ | ສະໜັບສະໜູນ | ສະໜັບສະໜູນ | ສະໜັບສະໜູນ | ສະໜັບສະໜູນ |
ບັນດາໜ້າທີ່ກ່ຽວຂ້ອງ
- ກັບຄືນລະດັບກ່ວານີ້ height
- ອີກກັບໜ້າຫນື່ງ width
- ກັບຄືນລະດັບກ່ວານີ້ Screen Window