简体   繁体   中英

Blur Effect : Silverlight Windows Phone 8.1

I am writing windows phone 8.1 silverlight app,

I have a Stackpanel in my XAML page, I want to create its background "Blur".

Is there any way to do it?

There is no easy way to apply effects such as blur to elements. More typical would be to dim them by placing a partially transparent rectangle over the disabled element.

If you really want blur you would need to render the element to a bitmap, but the bitmap contents, and then place that image over the original element.

If you have an image as background you could add the blurred effect by modifying the image before setting it as background. There's multiple libraries that allow you do to this eg. Win2D and Lumia Imaging SDK 2.0. They are both fairly simple to work with and have pro's and con's.

Nokia Imaging SDK allows you to work directly with bitmaps / writeablebitmaps while Win2D has a more smooth blur rendering. Here's a guide to how you can implement and work with both: http://www.blendrocks.com/code-blend/2015/1/29/implementing-image-blur-in-a-windows-universal-app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM