UIImageWriteToSavedPhotosAlbum creates black thumbnail in camera roll
I am saving image in the camera roll using UIImageWriteToSavedPhotosAlbum but always get an black thumbnail even if the 开发者_运维问答picture is correct.
Do you have pointers to address this?
Thanks in advance for your help.
Regards,
I had the same problem. Drawing the image within a UIGraphicsImageContext solves the issue:
CGRect rect = CGRectMake(0,0,100,100);
UIImage *image = ((put here your image));
UIGraphicsBeginImageContext(rect.size);
[image drawInRect:rect];
UIImage *result = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(
result, self, @selector(image:didFinishSavingWithError:contextInfo:),nil);
精彩评论