Search code examples
c#wpfshadoweffectblurry

Shadow effect and blurry text


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?


Solution

  • 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