Quote:
Originally Posted by RickMaddy
Step 2 Involves taking the UIImage from the image picker and using some Quartz 2D methods to draw that image to a context then drawing the overlays on top of that. Then using the function you mentioned to extract an image from the context.
|
I have found
an example that will save the active UIView to the photo library. A step closer, but it is effectively the same as taking a screen shot. It's capturing the "Take Picture" overlay, camera button, saving dialog, and everything else. The image quality seems to be degraded as well.
Code:
#pragma mark -
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
//This grabs everything on the screen. The camera button, "saved" dialog, etc.
UIGraphicsBeginImageContext(picker.view.bounds.size);
[picker.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
[self dismissModalViewControllerAnimated:YES];
}
This is confusing to me, as I thought by telling it to grab the "picker" view, it would only capture what was shown from the camera and its subview. Am I on the right path here? Thanks for any further guidance.