WPF DropShadowEffect Causing Blurriness

前端 未结 3 685
慢半拍i
慢半拍i 2021-01-02 05:21

I\'ve observed that applying a DropShadowEffect to a UIElement sporadically causes the UIElement\'s content to blur a bit. It\'s a pretty nasty effect: it can cause a photog

相关标签:
3条回答
  • 2021-01-02 05:42

    I'm not sure but try setting the BlurRadious for the Image.Effects to 0 by default it's 5 and see if it will help?

    <Image.Effect>
        <DropShadowEffect BlurRadius="0"/>
    </Image.Effect>
    
    0 讨论(0)
  • 2021-01-02 05:45

    There is a RendingQuality you can use to fix this issue. The default is biased for performance. Just do this:

    <DropShadowEffect Color="#FFFD1E1E" ShadowDepth="0" RenderingBias="Quality"/>
    
    0 讨论(0)
  • 2021-01-02 05:47

    What I do for this kind of scenarios is putting a Background Rectangle and apply the Blur effect just for that, so that the real content will be free from the effect, which in turn increases the performance. Because when you apply the effect to a visual all the subsequent children are also getting the effect applied, which makes the perf and looks gets bad. Try the below

     <Grid>
      <Rectangle ....>
      <Rectangle.Effect>
         <DropShadowEffect />
      </Rectangle.Effect>
     </Rectangle>
    ....Your content ...
    </Grid>
    
    0 讨论(0)
提交回复
热议问题