How to save an animated image to iPhone's photos album?

Posted by OpenThread on Stack Overflow See other posts from Stack Overflow or by OpenThread
Published on 2012-07-03T02:47:55Z Indexed on 2012/07/03 3:15 UTC
Read the original article Hit count: 165

Filed under:
|

I created an animated image, and it animates properly in an UIImageView:

- (void)viewDidLoad
{
    [super viewDidLoad];
    UIImage *image1 = [UIImage imageNamed:@"apress_logo"];
    UIImage *image2 = [UIImage imageNamed:@"Icon"];
    UIImage *animationImage = [UIImage animatedImageWithImages:[NSArray arrayWithObjects:image1, image2, nil] duration:0.5];
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
    imageView.image = animationImage;
    [self.view addSubview:imageView];
}

But if saved to photos album, it couldn't animate agian:

UIImageWriteToSavedPhotosAlbum(animationImage, 
                               self,
                               @selector(imageSavedToPhotosAlbum:didFinishSavingWithError:contextInfo:),
                               nil);

So is there any solution to save an animated image to photos album?

Special thanks!

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiimage