colorDepth Property

Deprecated. Retrieves the number of bits per pixel used for colors on the destination device or buffer.

Syntax

XML N/A
Scripting [ iBitsPerPixel = ] clientCaps.colorDepth

Possible Values

iBitsPerPixel Integer that receives one of the following values.
1, 4, 8, 15, 16, 24, 32
Off-screen buffering occurs based on the specified number of bits per pixel. The value 15 specifies 16 bits per pixel, in which only 15 bits are used in a 5-5-5 layout of red-green-blue (RGB) values.

The property is read-only. The property has no default value.

Remarks

 New for Windows Internet Explorer 9 As of Internet Explorer 9, this property is deprecated. Applications that depend on this property should be redesigned.

 New for Internet Explorer 9 Internet Explorer 9 always returns a value of 32.

To select an appropriate color to return to the browser, retrieve the property value through script.

If bufferDepth is 0 or -1 , colorDepth is equal to the bits-per-pixel value for the screen or printer. If bufferDepth is nonzero, colorDepth is equal to bufferDepth.

Example

This example displays all the properties available through the clientCaps behavior.

<HTML xmlns:IE>
<HEAD>
<STYLE> 
@media all {
   IE\:CLIENTCAPS {behavior:url(#default#clientCaps)}
}
</STYLE>

<SCRIPT>
function window.onload()
{
  sTempStr = "availHeight    = " + oClientCaps.availHeight    + "\n" + 
             "availWidth     = " + oClientCaps.availWidth     + "\n" + 
             "bufferDepth    = " + oClientCaps.bufferDepth    + "\n" +
             "colorDepth     = " + oClientCaps.colorDepth     + "\n" +
             "connectionType = " + oClientCaps.connectionType + "\n" +
             "cookieEnabled  = " + oClientCaps.cookieEnabled  + "\n" +  
             "cpuClass       = " + oClientCaps.cpuClass       + "\n" + 
             "height         = " + oClientCaps.height         + "\n" + 
             "javaEnabled    = " + oClientCaps.javaEnabled    + "\n" + 
             "platform       = " + oClientCaps.platform       + "\n" + 
             "systemLanguage = " + oClientCaps.systemLanguage + "\n" + 
             "userLanguage   = " + oClientCaps.userLanguage   + "\n" + 
             "width          = " + oClientCaps.width          + "\n" ;

  oPre.innerText = sTempStr;          
}
</SCRIPT>

</HEAD>
<BODY>
<H1>clientCaps Behavior Sample</H1>

<P>This example shows how to use the <B>clientCaps</B> 
behavior, introduced in Microsoft Internet Explorer 5, to obtain 
client capabilities information. The following is a sample of the 
information that can be obtained.</P>

<IE:CLIENTCAPS ID="oClientCaps" />

<PRE id="oPre"></PRE>
</BODY>
</HTML>

Code example: https://samples.msdn.microsoft.com/workshop/samples/author/behaviors/clientCaps/ccProperties.htm

Applies To

clientCaps

See Also

About Client Capabilities