高DPI屏幕上的MFC cdialogbar绘图问题 [英] MFC cdialogbar drawing issue on high DPI screen
问题描述
我创建了一个MFC SDI应用程序,并添加了CDialogBar以设置为主工具栏,就像我在附加的屏幕截图中看到的那样。它适用于Windows平板电脑设备的每个Windows操作系统(Xp,7,8,8.1,10),只有Microsoft Surface。
请看这个截图。 CDialogBar菜单被切断。我不知道为什么会这样。绘图问题始终只发生在具有高分辨率和高DPI屏幕的Microsoft Surface 3上,并且在任何其他平板电脑上都能正常工作。这是一个非常奇怪的问题所以我拖动工具栏(CDialogBar)并在任何地方放下,然后工具栏被重新绘制得很清楚。所以..通过这个问题,我确信这是重新绘制的问题。是否有任何绘图功能重绘该区域?
我附加了最小化的源代码来表示绘图问题。
绘图问题Screenschot
表示绘图问题的最小源代码
请帮帮我。谢谢
操作系统:Windows 10
DPI费率:150%
我的尝试:
要解决此问题,我一直在尝试将 DPI Awareness 属性设置为None,但图形界面并不好,而且它们都被拉伸了。我真的不喜欢这个解决方案,我必须找到其他解决方案而不将 DPI Awareness 设置为None。
强制执行重绘您可以使用 InvalidaRect 。
I have a MFC SDI application created and added CDialogBar to set as main toolbar as you look in the screenshot I attached. It works well on every windows os(Xp, 7, 8, 8.1, 10) of windows tablet devices except only Microsoft Surface.
Please look at this screenshot. the CDialogBar menu is cut off. I don't know reason why this happens. The drawing issue always only occurs on Microsoft Surface 3 which has high resolution and high DPI screen and it works good on any other tablet. This is very strange issue so I dragged toolbar(CDialogBar) and dropped down on any place then the toolbar was re-painted clearly. So.. through this issue, I am sure that this is re-drawing issue. Is there any drawing function to redraw that area?
I am attaching my minimized source code to represent drawing issue.
Drawing Issue Screenschot
Minimal Source code to represent drawing issue
Please help me. Thanks
Operating System: Windows 10
Tablet: Microsoft Surface 3
Tool: Visual Studio 2015 Update 3
DPI rate: 150%
What I have tried:
To resolve this issue, I have been trying to set DPI Awareness property to None, but the graphics Interface was not good and they were all stretched. I really don't like this solution, I have to find other solution without setting DPI Awareness to "None".
To enforce a redraw you can use InvalidaRect.
这篇关于高DPI屏幕上的MFC cdialogbar绘图问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!