1

I have an older application for which I want to use DPI virtualization on Windows 7 (also known as blurry form scaling). To try this in an example project, I did the following:

  • enable 125 % text display on a Windows 7 machine
  • disabled any manifest for that project
  • read Monitor.PixelsPerInch with a result of 120

I tried some things, but I was unable to get a result of 96 dpi here:

  • used <dpiAware>false</dpiAware> in an internal or external supplied manifest
  • changed application compatibility settings
  • changed windows theme

I additionaly thought that SetProcessDPIAware is called somwhere in the VCL. I found System.win.HighDpi which contains SetProcessDPIAware in its initialization block, but this unit is not included in my minimal sample.

Sample manifest (setting dpiAware seems to be ignored):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
    </requestedPrivileges>
  </security>
 </trustInfo>
    <application xmlns="urn:schemas-microsoft-com:asm.v3"> 
    <windowsSettings> 
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">False</dpiAware> 
    </windowsSettings> 
  </application> 
</assembly>
4

0 回答 0