有一個批評我的應用程序之一。顯示的文字被認爲是模糊的。我有點放大窗口,得到這個結果(所以他們是正確的)TextBlock在WPF 3.5中模糊
從我在這裏試圖在這個簡單的例子導致:
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<StackPanel>
<TextBlock Text="StatusDTC [1]"></TextBlock>
<TextBlock Text="StatusDTC [2]"
RenderOptions.BitmapScalingMode="NearestNeighbor"
RenderOptions.EdgeMode="Aliased"></TextBlock>
<TextBlock Text="StatusDTC [3]"
SnapsToDevicePixels="True"></TextBlock>
<TextBlock Text="StatusDTC [4]"
SnapsToDevicePixels="True"
RenderOptions.BitmapScalingMode="NearestNeighbor"
RenderOptions.EdgeMode="Aliased"></TextBlock>
</StackPanel>
</Grid>
</Window>
我發現了類似here東西。但UseLayoutRounding似乎不適用於.Net 3.5。我搜索了一下,發現.Net 4(TextOptions.TextRenderingMode)解決了這個問題,但是使用這個應用程序切換到.Net 4並不是一種選擇。我知道Win7呈現WPF不同於XP,我也開始了一個虛擬的XP,並嘗試在那裏。結果是一樣的。
有人有一個想法來清晰.net 3.5中的文本?
另請參閱此文章:http://stackoverflow.com/questions/190344/wpf-blurry-fonts-problem-solutions(主要是4.0) – fixagon