是否可以获取 CATransition 动画作为 UIImage?

发布于 2024-08-27 13:28:49 字数 836 浏览 3 评论 0原文

是否有可能获得 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

開玄 2024-09-03 13:28:49

您可以在动画运行时使用调度的 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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文