[英]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 pixelized (square text edges).当我使用 RenderTransform 属性并按比例放大 RichTextBox 时,我得到了像素化的放大文本(方形文本边缘)。
How I can prevent this?我怎样才能防止这种情况?
EDIT:编辑:
I have TextOptions.TextFormattingMode="Display" - when I remove this option everything is fine!我有 TextOptions.TextFormattingMode="Display" - 当我删除此选项时,一切都很好!
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.那是 20 的规模。我认为这可能取决于 ClearType 系统设置,您可以尝试在 RichTextbox 上设置RenderOptions.ClearTypeHint="Enabled"
,这可能会强制执行。
Also try setting TextOptions.TextRenderingMode="ClearType"
.也尝试设置TextOptions.TextRenderingMode="ClearType"
。
Edit: This SO question deals with text-rendering quite in-depth and might be helpful.编辑: 这个 SO question非常深入地处理文本渲染,可能会有所帮助。
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" TextOptions.TextFormattingMode="理想"
as suggested on: http://www.newventuresoftware.com/blog/wpf-text-rendering-quirks-scaletransform如建议: http://www.newventuresoftware.com/blog/wpf-text-rendering-quirks-scaletransform
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.