开发者

How to prevent text to pixelize when I use RenderTransform?

开发者 https://www.devze.com 2023-03-01 17:56 出处:网络
When I use RenderTransform property and scale up a RichTextBox I get magnified text which is pixeliz开发者_开发问答ed (square text edges).

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?

How to prevent text to pixelize when I use RenderTransform?

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:

How to prevent text to pixelize when I use RenderTransform?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消