0
你如何爲iOS相機膠捲寫入動畫GIF?據我所知,照片庫應用程序是無法播放的動畫,但例如發送電子郵件時,等如何將動畫GIF寫入iOS相機膠捲?
我已經試過我應該能夠將其導入:
UIImageWriteToSavedPhotosAlbum([UIImage imageWithData:self.imageData], nil, nil, nil);
但這似乎將其轉換爲JPG格式。
你如何爲iOS相機膠捲寫入動畫GIF?據我所知,照片庫應用程序是無法播放的動畫,但例如發送電子郵件時,等如何將動畫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];