Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Blurred background underneath an NSView

I've been looking around but I can't find an answer on this. I'm trying to make a view that will display it's contents normally, but anything that's underneath it (in the z axis) would be blurred.

I can't seem to manage to do this right off the bat. Anything I try (at best) blurs the contents of the view, not what's underneath.

like image 499
Pucho Avatar asked Nov 04 '22 22:11

Pucho


1 Answers

Check out this article on Cocoanetics, it gives you some instructions how to properly set up a NSView with blurred background: http://www.cocoanetics.com/2013/10/blurring-views-on-mac/

There's also a RMBlurredView class on Github: https://github.com/raffael/RMBlurredView

The idea behind it is to use a layer-backed NSView with a CIGaussianBlur CIFilter applied on the backgroundFilters property. All important flags are set correctly in the mentioned class.

like image 129
Raffael Avatar answered Nov 11 '22 21:11

Raffael