4

在某些地方,我启用了 sub antialiasing,而在其他地方,我没有。我使用结合 ClearType 的“显示”渲染模式。

但是,它确实是随机的,它使用灰度抗锯齿,而不是彩色抗锯齿。而且看起来很糟糕。我怎么能强迫它?

根据我猜的操作系统,它的工作方式不同。但奇怪的是,有些地方我有 SubAA,而另一些地方我没有。

当在不同的窗户上时,有些地方我整体上都有 subAA。您知道为什么会存在这种不一致吗?我要苏巴!!

谢谢

4

1 回答 1

3

There are certain situations when ClearType will get disabled in the rendering path which means it will then revert to grey scale anti-aliasing:

  • When you use AllowsTransparency="True" on a Window

  • When ClearType is disabled in Windows Settings (and you haven't used TextOptions.TextRenderingMode="ClearType" to force the use of ClearType)

  • ClearType text does not display correctly on a background that is not fully opaque i.e you introduce some transparency.

  • If Text is rendered to an intermediate target due to the use of a:

    • VisualBrush
    • DrawingBrush
    • OpacityMask
    • Viewport2DVisual3D
    • Effect
    • BitmapEffect

Are you using TextOptions.TextFormattingMode="Display" on your top level element i.e. Window? (the property is inherited so you if you put it there it should apply to everything in your Window).

You can use RenderOptions.ClearTypeHint="Enabled" to re-enable ClearType in the rendering path but you may have artifacts because there was usually a good reason to disable it.

You can use TextOptions.TextHintingMode="Fixed" when you have animations and you don't want to have lower-quality text rendering (i.e. ClearType disabled) while the animation is in effect.

You can use TextOptions.TextRenderingMode="ClearType" to force ClearType to be used even then the Windows System Settings have not enabled it (this won't do anything special for you in this case, it's here for reference).

于 2012-08-29T09:59:19.190 回答