On Dec 30, 2008, at 2:39 PM, Benjamin Dobson wrote:


On 30 Dec 2008, at 12:52:45, Benjámin Salánki wrote:

Hi all,

I was playing around with core animation and was wondering if sending animator to a view, specifically an NSImageView, will it only manage animation of bounds and size and rotation changes or can it too be used for changing the contents of the NSImageView? I am trying to animate the change in the NSImageView, but hence with no luck.

Hope I'm not mistaking core animation for what it is not :D

Core animation could do this, but it is not possible through animation proxies. I believe NSAnimation will be the easiest path to go down._______________________________________________

You could do something almost equivalent with animation proxies by swapping out subviews. In particular, setup a CATransition on the superview, then replace your NSImageView with a new instance, already loaded with an image.

Check out the SlideshowView class of the CocoaSlides example code.
        http://developer.apple.com/samplecode/CocoaSlides/index.html

Key lines of code would be something like this to setup:
CIFilter *filter = [CIFilter filterWithName: @"CIDissolveTransition"];
[filter setDefaults];
CATransition *transition = [CATransition animation];
transition.filter = filter;
transition.duration = 0.2;
[mySuperview setAnimations: [NSDictionary dictionaryWithObject: transition forKey:@"subviews"];

And then animate by doing something like,
[[mySuperview animator] replaceSubview: oldImageView withSubview: newImageView];_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to