`
zjjzmw1
  • 浏览: 1351956 次
  • 性别: Icon_minigender_1
  • 来自: 开封
社区版块
存档分类
最新评论

ios保存动态图片

    博客分类:
  • iOS
阅读更多
 
UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:ImageData], self,                                     @selector(image:didFinishSavingWithError:contextInfo:), nil);
 
 
 

但是当图片是Gif格式时,这种方法就不行了,因为UIImage是不支持Gif格式的,

这时我们只好使用以下方法:

 
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library writeImageDataToSavedPhotosAlbum:ImageData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {
            // Continue as normal...
        }];
        [library release];
 
 
 
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library writeImageDataToSavedPhotosAlbum:ImageData metadata:nil completionBlock:^(NSURL *assetURL, NSError *error) {
            // Continue as normal...
        }];
        [library release];
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics