Search code examples
objective-ccocoacore-graphicsripple

How to create an animated ripple effect on the desktop in OSX


I'm trying to create an animated ripple effect on the desktop of OSX. Not just the desktop, actually, but image of the desktop plus any windows on it.

As if the screen was a pond and a stone fell on a given point of it.

Can anyone give me some pointers on how to achieve this? Any sample source code woud be gratlt appreciated.


Solution

  • There is a small code fragment on this page, that describes how the author implemented a water ripple effect on iOS. Contains some development information and a video: http://fabiensanglard.net/fluide/

    Update:
    Core Image provides a CIRippleTransition (http://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CoreImageFilterReference/Reference/reference.html#//apple_ref/doc/filter/ci/CIRippleTransition - AFAIK this was used by Dashboard < 10.7)

    This example uses the CI Transition in combination with Core Animation: http://theocacao.com/document.page/528

    If you combine that with a simple screenshot you get an image of your desktop & the desired ripple effect.