locked
Windows store app - Blur effect on background RRS feed

  • Question

  • How do i  apply a Gaussian blur effect to my controls. Like for example the Background property of a StackPanel..

    This is all in XAML.

    Sunday, September 22, 2013 4:01 AM

Answers

  • Assuming you want to apply this to a static bitmap you can interop to Direct2d to apply a bitmap effect. There is nothing built into Xaml to do this.

    See Direct2D basic image effects sample (Windows 8) 

    You may be able to find 3rd party controls which wrap this for you.

    --Rob 

    • Marked as answer by Anne Jing Monday, September 30, 2013 2:08 AM
    Sunday, September 22, 2013 2:39 PM
    Moderator
  • There isn't really anything to do this.

    As a workaround use RenderTargetBitmap to render the background into an image (scaled down to much smaller image), then insert this image and stretch it back up to the size of the screen. The downscaling and stretching on rendering should give you a blurred effect. Sprinkle a little fade animation on it when you turn it on for what would probably be a super cool effect ;-)


    /Morten
    twitter: http://www.twitter.com/dotMorten
    blog: http://www.sharpgis.net


    Monday, September 23, 2013 3:25 AM

All replies

  • I want to do something like this.

    Sunday, September 22, 2013 5:45 AM
  • Assuming you want to apply this to a static bitmap you can interop to Direct2d to apply a bitmap effect. There is nothing built into Xaml to do this.

    See Direct2D basic image effects sample (Windows 8) 

    You may be able to find 3rd party controls which wrap this for you.

    --Rob 

    • Marked as answer by Anne Jing Monday, September 30, 2013 2:08 AM
    Sunday, September 22, 2013 2:39 PM
    Moderator
  • There isn't really anything to do this.

    As a workaround use RenderTargetBitmap to render the background into an image (scaled down to much smaller image), then insert this image and stretch it back up to the size of the screen. The downscaling and stretching on rendering should give you a blurred effect. Sprinkle a little fade animation on it when you turn it on for what would probably be a super cool effect ;-)


    /Morten
    twitter: http://www.twitter.com/dotMorten
    blog: http://www.sharpgis.net


    Monday, September 23, 2013 3:25 AM