在 windows 中获取缩放比例
Get the scaling percent in windows
我们可以使用下面的MFC代码获取屏幕尺寸;
GetWindowRect(GetDesktopWindow(), (CRect)rect);
我们可以使用 windows 设置 --> 系统 --> 显示 --> 比例和布局 --> "Change the size of text, apps, and other items" 更改屏幕比例。
这个ComboBox包括100%(推荐), 125% 175%等
当我改成125%或175%时,我无法得到正确的截图。
截图将被截断
如何获取屏幕缩放值,或者如何始终获取正确的屏幕截图?
这可能是由于 DPI virtualization 默认情况下标准化坐标,因此应用程序不需要知道缩放。
这可以通过以下方式避免:
- Enabling DPI awareness in the manifest.
- 或使用 API call such as SetProcessDpiAwarenessContext 设置 DPI 感知。
我们可以使用下面的MFC代码获取屏幕尺寸;
GetWindowRect(GetDesktopWindow(), (CRect)rect);
我们可以使用 windows 设置 --> 系统 --> 显示 --> 比例和布局 --> "Change the size of text, apps, and other items" 更改屏幕比例。 这个ComboBox包括100%(推荐), 125% 175%等
当我改成125%或175%时,我无法得到正确的截图。 截图将被截断
如何获取屏幕缩放值,或者如何始终获取正确的屏幕截图?
这可能是由于 DPI virtualization 默认情况下标准化坐标,因此应用程序不需要知道缩放。
这可以通过以下方式避免:
- Enabling DPI awareness in the manifest.
- 或使用 API call such as SetProcessDpiAwarenessContext 设置 DPI 感知。