Re: adding a page curl transition
Re: adding a page curl transition
- Subject: Re: adding a page curl transition
- From: Graham Cox <email@hidden>
- Date: Tue, 15 Sep 2009 10:53:09 +1000
Sorry, I hadn't read your message carefully. But you say "this must be
such a common thing to do..." then go on to describe an interface so
uncommon I don't think I've ever seen anything like it! Essentially
the Page Curl transition is just a time-based image processing
operation, so yes, you have to have the two images you need to
transition between. In your case you'll have to obtain those images by
something like the method you outline, there isn't a simple shortcut I
know of (though possibly NSView's methods for capturing the view's
contents to a bitmap could help - recall that the -contentView of a
window contains everything except the window structure - if you need
to include the structure as well you will need to grab the pixels from
the screen itself).
I'm not sure your interface will really make much sense to an end-user
(since it's uncommon and therefore unexpected behaviour), but who am I
to stop you? You're also likely to run into performance issues on
lower-end hardware since the screen capture/convert to core image/run
the transition will be pretty intensive. My simple slideshow would
barely manage 1-2 fps for the curl on my 1st Gen (not Core 2 Duo)
MacBook, and on Snow Leopard it's got even slower, to the point where
the time allotted to the transition often expires before it can
generate any frames, resulting in a simple non-curled jump to the
final frame. And that's when I do have both images on hand ready to
go. Core Image requires real GPU horsepower. It might be possible to
use OpenGL to get a similar effect that'll run on slower Macs but with
that approach you'll have to do it all yourself.
--Graham
On 15/09/2009, at 2:32 AM, Matt Neuburg wrote:
I'm thinking this is probably such a common thing to want to do that
someone
has already been down this road. Thx - m.
I've implemented this in a simple slideshow app that you can download
the source for. I just use Core Image - no point trying to roll your
own when the OS has a solution built right in - you need to have two
images in memory, the current one and the next one to show
Ah, but the crux of my question is that I don't have "the next one
to show".
I don't know what the window will look like when selecting a
different core
data entity until I select it, and by then it's too late. That's why
I'm
asking for a strategy...
For example, I can imagine something like this. Take a "screen shot"
of the
window. Cover the whole window with a secondary window. Behind the
secondary
window, move the primary window on to the next entity. Take a second
"screen
shot" of the window. Now I *do* have a "before" and "after" pair of
pictures. Perform the page curl animation in the secondary window, and
remove it.
That seems very elaborate, so before I do that I'm checking to see
whether
that strategy is on the right track. m.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden