the quality of saved image will lose when i'm using this method ...
UIImage *img=imageview1.image;
UIImageWriteToSavedPhotosAlbum(img,nil,nil,nil);
You need to wrap the image in a PNG representation, so that it's saved to the Photo Library in PNG format, rather than JPG format.
I used the following code based on the code from Ben Weiss: UIImageWriteToSavedPhotosAlbum saves to wrong size and quality for a side by side comparison.
// Image contains a non-compressed image stored within my Documents directory
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
NSData* imdata = UIImagePNGRepresentation ( image );
UIImage* im2 = [UIImage imageWithData:imdata];
UIImageWriteToSavedPhotosAlbum(im2, nil, nil, nil);
The image will be saved in the PNG format in the Photo Library so that it can be accessed/shared later in full quality.
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