是否可以将CATransition动画作为UIImage获得? [英] Is it possible to get a CATransition animation as UIImage?
问题描述
是否可以将CATransition动画作为UIImage获得?我举个例子:
is it possible, to get a CATransition animation as UIImage? I make a example:
CATransition *animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:0.35];
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
animation.type = @"pageCurl";
animation.fillMode = kCAFillModeForwards;
animation.endProgress = 0.65;
[animation setRemovedOnCompletion:NO];
[self.view.layer addAnimation:animation forKey:@"pageCurlAnimation"];
我正在使用动画。看起来像这样:
http://img269.imageshack.us/img269 /8577/bildschirmfoto20100331u.png
That is the animation, Im using. It looks like this: http://img269.imageshack.us/img269/8577/bildschirmfoto20100331u.png
如何捕捉这种卷曲效果?问题是我必须从self.view.layer中删除动画,但是以后需要放大图片。是否可以将动画(帧)作为图片?
我不想捕获整个UIView,仅捕获动画。
How can I capture this curl up - effect? The problem is that I have to remove the animation from self.view.layer, but I need the curl-up picture later. Is it possible to get the animation(frame) as picture? I dont want to capture the whole UIView, only the animation.
推荐答案
您可以在预定的时间使用UIGetScreenImage()动画正在运行。这将使您获得具有动画效果的屏幕截图作为图像。
信息,位于 http://www.tuaw.com/2009/12/15/apple-relents-and-is-now-allowing-uigetscreenimage-for-app-st/
You can use UIGetScreenImage() scheduled when the animation is being run. This would get you a screen capture as an image which would have the animation effect. Info at http://www.tuaw.com/2009/12/15/apple-relents-and-is-now-allowing-uigetscreenimage-for-app-st/
这篇关于是否可以将CATransition动画作为UIImage获得?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!