为什么 MFC 应用程序在具有相同分辨率的两台计算机上的缩放比例可能不同?
我开发了一个在 Windows 10 上运行的 MFC 应用程序。
在开发过程中,该应用程序在使用 1920x1080 显示器的计算机上看起来与预期一致。
我们的一位用户报告说,在具有相同显示器分辨率 (1920x1080) 的新笔记本电脑 (HP EliteBook 840 G8) 上,某些 MFC 对话框缩放不正确。
该机器是全新的,因此默认字体不太可能已更改。
用户报告计算机设置为 100% 缩放,文本缩放设置为“最小”。据我们所知,我们拥有完全相同的缩放设置。
为什么 MFC 对话框在用户计算机上没有采用相同的缩放比例?
我确实知道 MFC 对话框是按“对话框单位”缩放的,但客户表示这是一台全新的笔记本电脑,应该使用默认的 Windows 系统字体,因此我们应该看到相同的缩放比例。
我的下一步将是确认用户计算机上的系统字体。我是否错过了任何可能影响 MFC 对话框缩放的因素?
更新:
- 该用户有 1 个内置 1920x1080 显示器和 2 个外部 1920x1080 显示器
- 该系统安装了 Windows 10 的全新副本,但随后 IT 人员从其之前的系统复制了文件,因此它并非完全没有受到影响,尽管该用户认为操作系统未修改(待确认)
- Windows 10 上调整显示缩放的方法似乎有很多种,但看起来至少有 2 种只是访问相同设置的不同方式。 @IInspectable 指出,另一个页面上既有“比例和布局”设置,也有“使所有内容变大”设置。当我更改这些值中的任何一个时,我会得到相同的结果,这恰好与用户报告的结果相反。此外,如果我将一个值更改为 125%,则另一个值将显示为 125%。因此我相信这是相同的设置。
在用户 PC 上缩放不正确时对话框的外观示例(注意 - 请注意可见的图标,而不是我上传的图像的大小。用户发送了一个非常低的-资源截图。):
I develop an MFC application running on Windows 10.
Under development, the application looks as expected on our machines using 1920x1080 monitors.
One of our users reports that some MFC dialogs are scaled incorrectly on a new laptop (HP EliteBook 840 G8) with the same monitor resolution (1920x1080).
The machine is brand-new so it is unlikely that the default font has been changed.
The user reports that the computer is set to 100% scaling with text scaling set to 'smallest'. As far as we can tell, we have exactly the same scaling settings.
How could it be that the MFC dialog is not taking the same scaling on the user's machine?
I do understand that MFC dialogs are scaled in 'dialog units', but the customer has indicated that this is a brand-new laptop and should be using the default Windows system font, therefore we should be seeing the same scaling.
My next step will be to confirm the system font on the user's computer. Have I missed any factors which may affect MFC dialog scaling?
Updates:
- This user has 1x built-in 1920x1080 monitor and 2x external 1920x1080 monitors
- The system was installed with a clean copy of Windows 10 but then files were copied over from their previous system by IT, so it's not exactly untouched, although the user believes the OS was not modified (to be confirmed)
- There seem to be a variety of ways to adjust display scaling on Windows 10, but it looks like at least 2 of them are just different ways to access the same setting. @IInspectable points out that there is both a 'Scale and layout' setting and a 'Make everything bigger' setting on another page. When I change either of these values, I get the same result, which happens to be the opposite of what the user is reporting. Additionally, if I change one value e.g. to 125%, the other one then appears at 125%. Therefore I believe it is the same setting.
Example of the how the dialog is intended to look:
Example of how the dialog looks when scaled incorrectly on the user PC (note - pay attention to the icons which are visible, not the size of the image which I uploaded. The user sent a very low-res screenshot.):
Example of how the dialog looks when I increase monitor scaling to 125% on my own monitor:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Windows 显示缩放设置会影响对话框大小(及其字体、控件)。这与选择系统字体
Windows Display Zoom settings affects dialog sizes (and their fonts, controls). This is different than selecting the System Font