Enhanced system DPI scaling with VS2017

给你一囗甜甜゛ 提交于 2019-12-04 07:09:08

Add the gdiScaling setting to your application's manifest to tell Windows to apply GDI scaling on all monitors.

  1. Create a new file GdiScaling.manifest in your project.
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"  xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">
      <gdiScaling>true</gdiScaling>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>
  1. In project settings, in Manifest Tool, set Additional Manifest Files to GdiScaling.manifest. This will merge your GDI scaling settings into the rest of the generated manifest.

When you build, you will get a warning about Microsoft not having its act together, but you already knew that. :-) The exact text of the warning is this:

GdiScaling.manifest : manifest authoring warning 81010002: Unrecognized Element "gdiScaling" in namespace "http://schemas.microsoft.com/SMI/2017/WindowsSettings".

Fortunately, Windows doesn't care and recognizes the setting anyway.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!