How to prevent text to pixelize when I use RenderTransform?
When I use RenderTransform property and scale up a RichTextBox I get magnified text which is pixeliz开发者_开发问答ed (square text edges).
How I can prevent this?
EDIT:
I have TextOptions.TextFormattingMode="Display" - when I remove this option everything is fine!
Cannot claim that i can reproduce this with my current settings:
That is with a scale of 20. I think this could be dependent on the ClearType system settings, you can try setting RenderOptions.ClearTypeHint="Enabled"
on the RichTextbox, that might enforce it.
Also try setting TextOptions.TextRenderingMode="ClearType"
.
Edit: This SO question deals with text-rendering quite in-depth and might be helpful.
Edit: Check out this weirdness:
<TextBlock Text="Lorem ipsum dolor sit"
FontSize="20" TextOptions.TextFormattingMode="Display">
<TextBlock.RenderTransform>
<ScaleTransform x:Name="trans" ScaleY="10" ScaleX="10"/>
</TextBlock.RenderTransform>
<TextBlock.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="20" Duration="0:0:5"
Storyboard.TargetName="trans" Storyboard.TargetProperty="ScaleX"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
As soon as a certain scale is reached the text becomes clear for me, really odd...
This worked for me:
TextOptions.TextFormattingMode="Ideal"
as suggested on: http://www.newventuresoftware.com/blog/wpf-text-rendering-quirks-scaletransform
精彩评论