如何使Winform不受Windows DPI设置更改的影响?

编程入门 行业动态 更新时间:2024-10-27 09:47:25
本文介绍了如何使Winform不受Windows DPI设置更改的影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个放置图像的Winform。设计在Win 7上,DPI为100%。 当将DPI更改为125%或更高后显示相同的Winform时,我发现图像已移位Winform。 Winform可能因DPI更改而自动缩放,但Image(嵌入在Resx文件中)不会缩放。 目前,winform的AutoScaleMode设置为Font,AutoSizeMode设置为GrowOnly。我尝试在没有水果的情况下切换这些设置。 因此,如何在更高DPI设置的Winform上正确获取图像?或者如何让这个Winform不受DPI变化的影响? 请指教。 非常感谢任何帮助。

Hi, I have a Winform on which a image is placed. Designed on Win 7 with DPI at 100%. When the same Winform is displayed after changing the DPI to 125% or higher, I observe that the Image is displaced on the Winform. The Winform was possibly Auto scaled due to DPI changes but the Image (which is embedded in the Resx file) wont get scaled. Currently, The winform's AutoScaleMode is set to "Font" and the "AutoSizeMode" is set to "GrowOnly". I tried toggling these setting with no fruits. Thus, How would I get the Image properly on my Winform in Higher DPI settings? OR How can I make this Winform remain unaffected from DPI changes ? Please advise. Any help is greatly appreciated.

推荐答案

更改表单的 AutoScaleMode 到 Dpi 。 / ravi Change your Form's AutoScaleMode to Dpi. /ravi

更多推荐

如何使Winform不受Windows DPI设置更改的影响?

本文发布于:2023-10-29 20:31:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1540670.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不受   Winform   DPI   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!