0

I would like to add shadows outside tiles in my WPF application, but when I do, the text inside tiles is blurry. I tried this solution: WPF DropShadowEffect Causing Blurriness , but unfortunately shadow effect seems not to work at all. Are there any special attributtes in Rectangle which should be set? Could you give me some clues?

Community
  • 1
  • 1
eklxw
  • 189
  • 1
  • 14

1 Answers1

2

i got the same issue and solved this by using UseLayoutRounding="True"

EDIT

<Grid UseLayoutRounding="True" VerticalAlignment="Center" HorizontalAlignment="Center">

  <Grid.Effect>
      <DropShadowEffect ShadowDepth="0"
                        Color="Black"
                        BlurRadius="20" />
  </Grid.Effect>

  <!-- your content -->
  <Grid Background="White">
    <TextBlock Text="Test" FontSize="20" Margin="10" />
  </Grid>
</Grid>

results this

enter image description here

hope that helps

punker76
  • 14,326
  • 5
  • 58
  • 96
  • @user2876704 mh, it could help me and others to post your xaml code – punker76 Nov 29 '13 at 22:21
  • I think my code wouldn't make any difference. The problem is that your solutions don't work even if I put them in blank page/window. 1) There's shadow and so is blurring 2) No shadow, no blurring ;) – eklxw Nov 29 '13 at 22:45
  • @user2876704 my mistake, i updated my answer to the working solution. – punker76 Nov 30 '13 at 10:09
  • Thank you very much! Your solution works, but if there is more elements with shadow on the page, UseLayoutRounding property should be set on a root element. – eklxw Nov 30 '13 at 12:35