HighDpiMode 枚举

定义

指定可应用于应用程序的不同高 DPI 模式。Specifies the different high DPI modes that can be applied to an application.

public enum class HighDpiMode
public enum HighDpiMode
type HighDpiMode = 
Public Enum HighDpiMode
继承
HighDpiMode

字段

DpiUnaware 0

应用程序窗口不会随着 DPI 更改而缩放,始终假定缩放比例为 100%。The application window does not scale for DPI changes and always assumes a scale factor of 100%.

DpiUnawareGdiScaled 4

类似于 DpiUnaware,但提高了基于 GDI/GDI+ 的内容的质量。Similar to DpiUnaware, but improves the quality of GDI/GDI+ based content.

PerMonitor 2

此窗口会在创建 DPI 时对其进行检查,并在 DPI 更改时调整缩放比例。The window checks for DPI when it's created and adjusts scale factor when the DPI changes.

PerMonitorV2 3

类似于 PerMonitor,但启用了子窗口 DPI 更改通知、comctl32 控件的改进缩放和对话框缩放。Similar to PerMonitor, but enables child window DPI change notification, improved scaling of comctl32 controls, and dialog scaling.

SystemAware 1

此窗口会查询一次主监视器的 DPI,并将其用于所有监视器上的应用程序。The window queries for the DPI of the primary monitor once and uses this for the application on all monitors.

注解

指定高 DPI 模式取决于运行应用程序的计算机的操作系统版本。Specifying the high DPI mode is dependent on the OS version of the machine you're running your application on. 设置高 DPI 模式将在运行 Windows 10 创意者更新(版本1703)或更高版本的计算机上运行。Setting the high DPI mode will work on machines running Windows 10 Creators Update (version 1703) or later versions.

在应用程序开始运行后更改 DPI 模式不会影响缩放(也就是说,更改不会生效)。Changing the DPI mode after the application has started running doesn't impact scaling (that is, the change won't take effect).

如果使用的PerMonitor是值,并且有多个监视器附加了不同的 DPI 设置,则当窗口从一个监视器移到另一个监视器时,dpi 可能会更改。If you're using the PerMonitor value and there is more than one monitor attached with different DPI settings, the DPI may change when the window is moved from one monitor to the other. 在这种情况下,应用程序会根据新监视器的 DPI 设置进行重新缩放。In this case, the application rescales according to the new monitor's DPI settings. 或者,在更改了窗口的监视器的 OS 缩放设置后,可以更改窗口的 DPI。Alternatively, the DPI of a window can be changed when the OS scaling setting is changed for the monitor the window is on.

适用于