在高分辨率屏幕中调整按钮图像大小
我有一个带有很多按钮栏和很多图形界面的项目,我遇到的问题是,使用图形卡和新的高分辨率显示器,在缩放时,例如,在屏幕配置中设置 150%,按钮出现时图像非常小;内部图像不会像应用程序的其余部分一样重新缩放到 150%。
我以这种方式向一系列按钮分配图像:
CImageList ilTest;
ilTest.Create(IDB_IL_DOC, 32, 0, RGB(255, 0, 255));
m_picDoc.SetIcon (ilTest.ExtractIcon (0));
...
是否可以以某种方式对其进行修改,以便按钮图像以与界面其余部分相同的比例缩放?
I have a project with a lot of button bars and a lot of graphic interfaces, the problem I have is that with graphic cards and new high-resolution monitors, when scaling, for example, 150% is set in the screen configuration, the buttons appear with the image very small; the image inside is not re-scaled to 150% like the rest of the application.
There is a series of buttons to which I assign the image in this way:
CImageList ilTest;
ilTest.Create(IDB_IL_DOC, 32, 0, RGB(255, 0, 255));
m_picDoc.SetIcon (ilTest.ExtractIcon (0));
...
Can it be modified in some way so that the button image is scaled in the same proportion as the rest of the interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅本文:MFC 应用程序现在默认为具有 DPI 意识。
引用介绍性段落:
它最终链接到这篇文章: Windows 上的高 DPI 桌面应用程序开发,其中通过一些示例进行了详细介绍。
我承认我在自己的项目中并没有深入研究解决DPI问题。这是我应该做的事情。
See this article: MFC applications now default to being DPI-aware.
To quote the introductory paragraph:
It eventually links to this article: High DPI Desktop Application Development on Windows which goes into details with some examples.
I admit that I have not delved into addressing the DPI issues in my own projects. It is something I should do.