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: Use of this property requires the Professional or Enterprise Edition of BrowserHawk.
Example (C#):
<html>
<%
ExtendedOptions options = new ExtendedOptions();
options.AddProperties("DisplayXDPIActual,DisplayYDPIActual,DisplayXDPILogical,DisplayYDPILogical");
ExtendedBrowserObj extBrow = BrowserObj.GetExtendedBrowser(options);
BrowserObj bhObj = BrowserObj.GetBrowser();
if (bhObj.Browser == "IE" && bhObj.Majorver >= 6) { %>
DisplayXDPIActual: <% = extBrow.DisplayXDPIActual %> <br>
DisplayYDPIActual: <% = extBrow.DisplayYDPIActual %> <br>
DisplayXDPILogical: <% = extBrow.DisplayXDPILogical %> <br>
DisplayYDPILogical: <% = extBrow.DisplayYDPILogical %> <br>
Horizontal scale factor: <% = extBrow.DisplayXDPIActual / extBrow.DisplayXDPILogical %> <br>
Vertical scale factor: <% = extBrow.DisplayYDPIActual / extBrow.DisplayYDPILogical %> <br>
<% } else { %>
DPI properties require IE 6 or higher
<% } %>
</html>
Special notes for this property:
This property is only available for IE 6.0 and higher on Windows
Actual vertical DPI can be obtained from the DisplayYDPIActual property. Note that on most systems there is no difference between horizontal and vertical DPI.
If the user’s JavaScript is disabled this property will not be available.
See Also:
DisplayYDPIActual Property (.NET)