5

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.

1 Answer 1

4

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.

3
  • I just tried the sample app you mentioned, but precisely when I try to click on an image (to produce the ripple effect), I get a EXC_BAD_ACCESS. :-P
    – cfischer
    Aug 25, 2011 at 13:41
  • Sadly the sample has a lot of memory issues. But Xcode generates a lot of warnings about missing @property attributes. Also the Static Analyzer points out a lot of the memory troubles. To get rid of the crasher you mentioned, set the "retain" attribute for the following properties: CALayer* imageLayer; CALayer* imageLayerAlternate; Aug 25, 2011 at 14:10
  • Thank you very much. Wish I could accept an answer twice! ;-)
    – cfischer
    Aug 25, 2011 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.