アニメーション GIF を iOS カメラロールに書き込むにはどうすればよいですか? フォト ギャラリー アプリでアニメーションを再生できないことは理解していますが、たとえばメールを送信するときにインポートできるはずです。
私はもう試した:
UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:self.imageData], nil, nil, nil);
しかし、これはそれをjpgに変換するようです。
インスタンスを作成しALAssetLibrary
ます。このメソッドを次のように使用しますNSData
。writeImageDataToSavedPhotosAlbum:metadata:completionBlock:
このように iOS メールの添付ファイルで gif を使用できます。
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@""];
// Attach an image to the email
NSString *path = [[NSBundle mainBundle] pathForResource:@"Your image name" ofType:@"gif"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"image/gif" fileName:@"photo name"];
NSString *emailBody = @"";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];