English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Attribut pixelDepth de l'écran

Objet Screen JavaScript

LepixelDepthAttribut lecture seule qui renvoie la profondeur de pixel de l'écran.

La profondeur de pixel est le nombre de bits utilisés par chaque pixel par le matériel d'affichage du système.

Syntaxe :

screen.pixelDepth
var x = "Profondeur de pixel : " + screen.pixelDepth;
Vérifiez ici‹/›

Compatibilité du navigateur

Tous les navigateurs prennent en charge pleinement l'attribut pixelDepth :

Attribut
pixelDepthEstEstEstEstEst

Détails techniques

Valeur de retour :Un nombre, représentant la résolution de couleur, par pixel.
Valeurs possibles :
  • Par pixel1Bits

  • Par pixel4Bits

  • Par pixel8Bits

  • Par pixel15Bits

  • Par pixel16Bits

  • Par pixel24Bits

  • Par pixel32Bits

  • Par pixel48Bits

Plus d'exemples

Ce exemple affiche toutes les propriétés d'écran :

var txt = "";
txt += "<p>Largeur totale/height: " + screen.width + "*" + screen.height + "</p>";
txt += "<p>Largeur disponible/height: " + screen.availWidth + "*" + screen.availHeight +"</p>";
txt += "<p>Profondeur de couleur : " + screen.colorDepth + "</p>";
txt += "<p>Resolution de couleur : " + screen.pixelDepth + "</p>";
document.write(txt);
Vérifiez ici‹/›

Références associées

Référence screen :Propriété screen.availHeight

Référence screen :Propriété screen.availWidth

Référence screen :Propriété screen.height

Référence screen :Propriété screen.width

Référence screen :Propriété screen.colorDepth

Objet Screen JavaScript