如何获取所有支持的DPI /分辨率的列表 [英] How to get a list of all supported DPI/resolution

查看:516
本文介绍了如何获取所有支持的DPI /分辨率的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取所有支持的DPI /分辨率的列表?例如在Windows 10上用于DPI列表:有四种选择:100%,125%,150%,175%

How to get a list of all supported DPI/resolution? e.g. on windows 10 for DPI list: there are four choices: 100%, 125%, 150%, 175%

谢谢

推荐答案

您好,

感谢您发布MSDN论坛。

Thank you for posting MSDN forum.

根据您的说明,  I 无法得到你的意思,你想在一个进程或一个应用程序中启用不同的DPI缩放模式吗?

According to your description, I cannot get your mean, Did you want to enable the use of different DPI scaling modes within a single process or one application ?

如果是,你可以尝试使用
SetThreadDpiAwarenessContext
方法。

If yes, you can try to use SetThreadDpiAwarenessContext method.

例如,应用程序的主要顶级窗口可以基于每个监视器进行缩放,而辅助顶级窗口可以通过操作进行位图缩放来缩放系统。

For example, an application's primary top-level window could be scaled on a per-monitor basis while secondary top-level windows could be scaled via bitmap-scaling by the operating system.

使用 SetThreadDpiAwarenessContext 的常见方案如下:从一个运行一个上下文的线程开始(例如
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE )暂时切换到其他上下文( DPI_AWARENESS_CONTEXT_UNAWARE ),创建一个窗口,然后立即将线程上下文切换回其先前的状态。创建的窗口
将具有 DPI_AWARENESS_CONTEXT_UNAWARE 的DPI上下文,而调用线程的上下文将恢复为
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ,随后调用
SetThreadDpiAwarenessContext

A common scenario for the use of SetThreadDpiAwarenessContext is as follows: Begin with a thread that is running with one context (such as DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE) temporarily switch to a different context (DPI_AWARENESS_CONTEXT_UNAWARE), create a window, and then immediately switch the thread context back to its previous state. The created window will have a DPI context of DPI_AWARENESS_CONTEXT_UNAWARE, while the calling thread’s context will be restored to DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE with a subsequent call to SetThreadDpiAwarenessContext.

最佳 此致,

Best  Regards,

Hart


这篇关于如何获取所有支持的DPI /分辨率的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆