DisplayXDPIActual Property

Type: Integer

 

Returns the actual number of horizontal dots per inch (DPI) of the system's display.

 

Internet 6.0 and has the ability to automatically adjust the scale of a display to try and compensate for size differences in text when viewed at higher DPI settings. Some computer systems that provide DPI settings greater than 96 DPI ship with IE configured to provide this automatic adjustment.

 

This automatic scaling feature may have adverse effects on the format and display of a web page. In addition, higher DPI settings even without automatic scaling can have similar adverse effects.

 

The DisplayXDPIActual and DisplayXDPILogical properties are useful in detecting this situation so you can dynamically change the format and size of your page layout, or so that you can alert the user to adjust their settings for a better experience.

 

Tip: You can calculate the horizontal scale factor, if any, that IE is using by using this formula:

horizontalScaleFactor = DisplayXDPIActual / DisplayXDPILogical

 

Note: You must call the GetExtPropertiesEx method before checking the value of this property. This property requires the Professional or Enterprise Edition of BrowserHawk.

 

Example:

<%

set bhObj = Server.CreateObject("cyScape.browserObj")

bhObj.SetExtProperties "DisplayXDPIActual,DisplayYDPIActual,DisplayXDPILogical,DisplayYDPILogical"

bhObj.GetExtPropertiesEx

%>

<html>

<% if bhObj.Browser = "IE" and bhObj.Majorver >= 6 then %>

DisplayXDPIActual: <% = bhObj.DisplayXDPIActual %> <br>

DisplayYDPIActual: <% = bhObj.DisplayYDPIActual %> <br>

DisplayXDPILogical: <% = bhObj.DisplayXDPILogical %> <br>

DisplayYDPILogical: <% = bhObj.DisplayYDPILogical %> <br>

Horizontal scale factor: <% = bhObj.DisplayXDPIActual / bhObj.DisplayXDPILogical %> <br>

Vertical scale factor: <% = bhObj.DisplayYDPIActual / bhObj.DisplayYDPILogical %> <br>

<% else %>

DPI properties require IE 6 or higher

<% end if %>

</html>

 

Special notes for this property:

 

See Also:

DisplayYDPIActual Property

DisplayXDPILogical Property

DisplayYDPILogical Property