Re: Animated Ripple Effect
Re: Animated Ripple Effect
- Subject: Re: Animated Ripple Effect
- From: Greg Herlihy <email@hidden>
- Date: Tue, 18 Apr 2006 21:40:45 -0700
- Thread-topic: Animated Ripple Effect
I think the easiest way to "ripple" a window's contents would be to compose
the desired ripple effect within Quartz Composer. With Quartz Composer it is
possible to fine tune (and preview) the ripple effect far more conveniently
than it would be were the effect implemented in source code. Furthermore, a
Quartz composition is much more likely to take advantage of any available
graphics hardware acceleration when rendering the effect than would a custom
implementation. Moreover the Quartz Composer IB palette makes it easy to
integrate the QC composition into an app's UI with Interface Builder.
The basic steps to ripple a window using this technique would be as follows:
first obtain a bitmap image of the target window's current contents (see
cacheDisplayInRect:toBitmapImageRep:) which will serve as input to the QC
composition. Next, create an overlay window of the same size and location as
the target window and place a QCView (created with Interface builder and
stored the program's nib file) within it. As the QC composition runs in the
overlay window, the target window's contents will appear to ripple in place.
Note that this technique can be used in any Cocoa app to apply practically
any kind of Core Image effect (or combination thereof) - including rotating,
flipping, bending, bulging, and swirling (just to mention a few of the
possibilities) - to a window's contents. Of course, it is easy to get
carried away, so exercising some restraint is probably advisable.
Greg
On 4/18/06 5:12 PM, "Steve Sheets" <email@hidden> wrote:
> Most of the animated transition effects are fairly obvious how to
> create (fade in, zoom in, slide in, spin in, etc), but how does one
> create the Ripple effect using Cocoa & Quartz? I do not want to know
> there is a Quicktime Transition (assuming there in), but instead what
> type of calls (with Math) could be used to create the animation. I
> have created lots of code (using NSTimers & NSImages) to animate
> windows and custom views, but would like to duplicate the cool ripple
> effect inside a window. Any suggestions, source code or pointers
> would be appreciated!
>
> Thank you,
>
> Steve Sheets
> email@hidden
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden