tags:

views:

48

answers:

3

Hi,

I'm I'm currently making a wpf c# app. I have some storyboards which animate some elements. Please look at the picture below:

alt text

This is my grid with some controls after it has been animated. Notice the improper rendering of the text and the rectangle. How can I solve this rendering?

UPDATE: Code request by Rachel:

<TextBlock Height="35.667" Margin="73.667,19,0,0" TextWrapping="Wrap" VerticalAlignment="Top" FontSize="32" Foreground="Black" Text="close" HorizontalAlignment="Left" Width="73.667" UseLayoutRounding="True"/>

    <Rectangle x:Name="BS2" Fill="#FF0178D3" HorizontalAlignment="Left" Height="64.166" Margin="25,0,0,0" Stroke="Black" VerticalAlignment="Top" Width="30.667" StrokeThickness="0" UseLayoutRounding="True"/>
A: 

try UseLayoutRounding and SnapsToDevicePixels = true

Edit:

I'm curios how does it look like when you do something like

<ScaleTransform ScaleX="1.01" ScaleY="1.01" />

Also you could try wrap it in some other panel (Canvas f.e.)

lukas
Tried, nothing changes
internetmw
I had similar problem under .Net 3.5. In .Net 4.0 with these it looks fine. also you could update drivers
lukas
+2  A: 

Have you tried testing it on several different machines? WPF can be sensitive to differences in graphics cards.

Daniel Earwicker
Agree with this. I've had something look perfectly clear and easy to read on my machine, but be really blurry and an eyesore on someone elses machine.
Rachel
Allright I guess I'll have to live with this then. However I do find it strange that some of the text or rectangles in a grid show this problem and others don't
internetmw
I've seen differences between machines bought in the same shipment from Dell with the exact same model of graphics card! One machine displays large text fine, the other has "ragged" edges on the text. I put a new graphics card in the faulty machine, and it's fine now.
Daniel Earwicker
A: 

Try changing TextOptions.TextRenderingMode and see if that makes a difference. The results vary per machine.

Rachel
Tried all options but nothing changes
internetmw