是否可以获取 CATransition 动画作为 UIImage?
是否有可能获得 CATransition 动画作为 UIImage?我举个例子:
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
如何捕捉这种卷曲效果?问题是我必须从 self.view.layer 中删除动画,但稍后我需要卷曲图片。是否可以将动画(帧)获取为图片? 我不想捕获整个 UIView,只想捕获动画。
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"];
That is the animation, Im using. It looks like this:
http://img269.imageshack.us/img269/8577/bildschirmfoto20100331u.png
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在动画运行时使用调度的 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/