Aero:如何在玻璃上绘制ClearType文本?

编程入门 行业动态 更新时间:2024-10-20 08:01:22
本文介绍了Aero:如何在玻璃上绘制ClearType文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用GDI +在玻璃上绘制文本:

Using GDI+ to draw text on glass:

graphics.DrawString(s, Length(s), font, MakePointF(x, y), brush);

您会注意到启用了ClearType的文本在玻璃上的绘制效果非常 :

You'll notice that the ClearType enabled text draws very poorly on glass:

但是,如果用玻璃杯禁用文字, ,请罚款:

But with glass disabled the text, of course, draw fine:

通过比较的方法是抗锯齿字体平滑:

这是没有字体平滑:

注意:没有字体平滑效果比实际效果好,因为StackOverflow会调整显示器上图像的大小。

Note: No font smoothing looks better than it really does because StackOverflow resizes the images on your monitor.

如何绘制ClearType文本

How do i draw ClearType text on glass?

  • Win32本机
  • 不是.NET(本机为 ie )
  • 不是Winforms(本机为 ie )
  • GDI +(本地的 ie )
  • Win32 native
  • not .NET (i.e. native)
  • not Winforms (i.e. native)
  • GDI+ (i.e. native)

什么马克暗示您无法兑现用户的文本呈现偏好设置(即 SystemDefault 。 ClearType在玻璃上不起作用,因此无法使用。

What Mark is suggesting is that you cannot honor the user's preferences for text rendering (i.e. "SystemDefault". ClearType does not function on glass, and you cannot use it.

换句话说,如果要在玻璃上渲染,则必须使用以下命令覆盖文本渲染:

In other words, if you're rendering on glass you must override the text rendering with:

graphics.SetTextRenderingHint(TextRenderingHintAntiAliasGridFit);

否则,应将 TextRenderingHint 保留在默认 TextRenderingHintSystemDefault 。

Otherwise you should leave the TextRenderingHint at it's default TextRenderingHintSystemDefault.

  • Aero:如何在玻璃上绘制纯色?
  • Windows Aero:涂什么颜色才能使玻璃出现?
  • WPF:将玻璃扩展到客户区会完全禁用ClearType
  • Aero: How to draw solid colors on glass?
  • Windows Aero: What color to paint to make "glass" appear?
  • WPF: Extending glass into client area disables ClearType entirely
推荐答案

问题是绘图方式所固有的。您所有的文字都在黑色背景上绘制,然后合成到玻璃背景上;半透明的字体平滑与黑色结合使用,使颜色接近黑色。

The problem is inherent to the way drawing is performed. All of your text is being drawn on a black background, then composited onto a glass background; the semi-transparent font smoothing is being combined with black to make near-black.

更多推荐

Aero:如何在玻璃上绘制ClearType文本?

本文发布于:2023-11-12 03:57:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580451.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本   玻璃   如何在   Aero   ClearType

发布评论

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

>www.elefans.com

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