我一直在WPF中遇到文字模糊的问题。我知道有这些“显示”选项,而且我已经搜索了很多,但问题是它仍然不正确。让我演示一下:
左侧是我在Visual Studio 2011 Developer Preview的“预览模式”中看到的内容,右侧是我实际运行程序时看到的内容。我想要的是左侧的ClearType,它迄今为止是最好的,但在实际程序运行模式下,这些选项都不好看。这是代码:
<StackPanel TextOptions.TextFormattingMode="Display">
<TextBlock>Hello World ... ClearType</TextBlock>
<TextBlock TextOptions.TextRenderingMode="Grayscale">Hello World ... Grayscale</TextBlock>
<TextBlock TextOptions.TextRenderingMode="Aliased">Hello World ... Aliased</TextBlock>
</StackPanel>
我该如何在Visual Studio中以预览模式渲染文本?
编辑:我发现这个问题的原因是因为我使用了WPF Shell Integration Library与玻璃样式。这种玻璃样式会导致WPF不使用ClearType。
.NET Framework 4.5客户端配置文件
。 - Tower