150个缩放C#winforms中的文字模糊不清 [英] Text is blurry in 150 scaling C# winforms

查看:135
本文介绍了150个缩放C#winforms中的文字模糊不清的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,

我正在开发一个支持DPI意识的应用程序。但我遇到的问题是"文字模糊"。 150缩放DPI。 

I am developing, an application which supports the DPI awareness. But the problem i have is "Text is blurry" in 150 scaling DPI. 

我遇到过使用SetProcessDPIAware函数。但这不适合我的申请。 

I have come across, using SetProcessDPIAware function. But this does not suits, for my application. 

我大部分时间都使用过 

Mostly i have used 

1)TextRenderer.DrawText

1) TextRenderer.DrawText

2)我的应用程序中的Graphics.DrawString 

2) Graphics.DrawString 

。任何人都可以建议我,如果有选项可以避免150缩放DPI文本模糊。

in my application. Can anyone suggest me, if there is option to avoid text blurry in 150 scaling DPI.

示例链接:  http://1drv.ms/1fjNOq4

Sample Link: http://1drv.ms/1fjNOq4

MSDN警告

推荐答案

使用其他字体。使用不同的缩放比例。顺便说一句,"150缩放DPI"是什么意思?什么是"DPI意识"在你眼里?我们是在谈论WinForms还是WPF?

Use a different font. Use a different scaling. btw, what do you mean by "150 scaling DPI"? What is "DPI awareness" in your eyes? Are we talking about WinForms or WPF?

您需要为所有容器和控件使用AutoScaleMode。并为所有控件使用相同的默认字体大小。当您需要不同的尺寸时,请更改控件,而不是容器。使用Points for Graphics.DrawString 和
TextRenderer.DrawText作为字体大小单位。像素总是一个像素。这些应该自动缩放。

You need to use either AutoScaleMode for all of your containers and controls. And use the same default font size for all of your controls. When you need a different size, change the control, not the container. Use Points for Graphics.DrawString and TextRenderer.DrawText as font size unit. Pixels are always a pixel. These should scale automatically.

同时阅读
编写DPI-Aware桌面和Win32应用程序。


这篇关于150个缩放C#winforms中的文字模糊不清的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆