I'm currently using UIGraphicsGetImageFromCurrentImageContext() to save a content's image to a user's camera roll, but the image quality is worse than if I do a screen shot in the simulator. Is there any way to improve it? And what format the saved image is in anyway? Bmp? Is there any way to change this?
Here's my save code:
CGSize size = [content bounds].size;
UIGraphicsBeginImageContext(size);
[[content layer] renderInContext:UIGraphicsGetCurrentContext()];
UIImage *originalImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(originalImage, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
Instead of using UIGraphicsBeginImageContext
you should be using:
UIGraphicsBeginImageContextWithOptions(size, NO, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With