3

I have a control with an animation applied on the Height property. The control contains a ListBox with TextBlock as ListItem. But the text is blurred, broken, or pixellated during animation. Below please see the images during different points in the animation.

Blurred "Ready For Operation

Broken text " Tripped Circuit Breaker ...

Relatively better text

The code of my TextBlock:

<TextBlock x:Name="Description"
Padding="0,2,0,2"
Grid.Column="1" 
TextOptions.TextRenderingMode="ClearType"
HorizontalAlignment="Left" VerticalAlignment="Center"
Text="{Binding Description}"
ToolTip="{Binding Description}"
TextTrimming="CharacterEllipsis"
Foreground="White"
FontSize="11" FontFamily="{DynamicResource StandardFontType}"/>

I tried all different options for TextOptions.TextRenderingMode and DisplayModes from this link, but nothing could solve my problem.

Community
  • 1
  • 1
Irfan
  • 2,713
  • 3
  • 29
  • 43

1 Answers1

3

Try switching between:

TextOptions.TextFormattingMode="Ideal"

and

TextOptions.TextFormattingMode="Display"

Also please note that Borders with shadows can cause trouble with Text rendering, see this SO link

As described in that link, you can have the best of both worlds (the shadows + the nicely rendered text) by using a Grid and putting both elements in the same Row/Column: they are therefore superimposed but the text won't suffer from the shadow.

Community
  • 1
  • 1
Louis Kottmann
  • 16,268
  • 4
  • 64
  • 88
  • I already tried both these options, but same problem stays. With TextOptions.TextFormattingMode="Display", a little better look, but still very ugly and broken. – Irfan Oct 17 '12 at 14:48
  • Try dissociating the text from the shadowed element – Louis Kottmann Oct 17 '12 at 14:49
  • That did the magic. I removed dropshadow for the control and it worked for me. But I lost the shadow effect :(. – Irfan Oct 17 '12 at 15:03
  • super @Baboon... with a little modification, now I got ShadowEffect also working with fixed text. Thank you very much for support. – Irfan Oct 17 '12 at 15:42