Is it possible to get a CATransition animation as UIImage?

喜欢而已 提交于 2020-01-03 05:54:11

问题


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.


回答1:


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/



来源:https://stackoverflow.com/questions/2551521/is-it-possible-to-get-a-catransition-animation-as-uiimage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!