English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
colorDepth読み取り専用の属性は、スクリーンの色深度を返します。
colorDepthは、単一のピクセルの色を表すビット数です。
colorDepthは、デバイスのスクリーンがどれだけの色を生成できるかを示します。
例えば、色深度が8のスクリーンは生成できる256色の種類(2 8)。
screen.colorDepth
var x = "Color Depth: " + screen.colorDepth;テストを見て‹/›
すべてのブラウザがcolorDepth属性を完全にサポートしています:
属性 | |||||
colorDepth | は | は | は | は | は |
返り値: | 画像を表示するためのパレットのビット深度をピクセル単位で示す数字。 可能な値:
|
---|
この例では、すべてのスクリーン属性を表示しています:
var txt = ""; txt += "<p>Total width/height: " + screen.width + "*" + screen.height + "</p>"; txt += "<p>Available width/height: " + screen.availWidth + "*" + screen.availHeight +"</p>"; txt += "<p>Color depth: " + screen.colorDepth + "</p>"; txt += "<p>Color resolution: " + screen.pixelDepth + "</p>"; document.write(txt);テストを見て‹/›
screen 参考情報:screen.availHeight属性
screen 参考情報:screen.availWidth属性
screen 参考情報:screen.height属性
screen 参考情報:screen.width属性
screen 参考情報:screen.pixelDepth属性