Finestra screen.pixelDepth
Esempio
Ottieni la risoluzione del colore del tuo schermo:
let depth = screen.pixelDepth;
Altri esempi "Provalo da solo" di seguito.
Definizione e utilizzo
La pixelDepth
proprietà restituisce la profondità del colore dello schermo.
La pixelDepth
proprietà restituisce la profondità del colore in bit per pixel.
La pixelDepth
proprietà è di sola lettura.
Guarda anche:
La proprietà screen.colorDepth
Nota
La proprietà pixelDepth non è supportata in Internet Explorer 9 e versioni precedenti.
Tuttavia, pixelDepth e colorDepth restituiscono lo stesso valore.
Poiché tutti i browser supportano colorDepth, utilizzare invece quella proprietà.
Sintassi
screen.pixelDepth
Valore di ritorno
Tipo | Descrizione |
Un numero | La risoluzione del colore in bit per pixel: 1, 4, 8, 15, 16, 24, 32 o 48. |
Altri esempi
Tutte le proprietà dello schermo:
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;
Supporto browser
screen.pixelDepth
è supportato in tutti i browser:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |