I want to take a snapshot of a view (WebView) or, if that is not possible, the whole screen, so I can save it into the user's photo gallery. I was wondering if this is possible.
Asked
Active
Viewed 2,581 times
1 Answers
3
To get the image, you'll want to use:
UIGraphicsBeginImageContext(self.bounds.size);
[theView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Then, to save to the Photos Library:
UIImageWriteToSavedPhotosAlbum(viewImage,nil,NULL,NULL);

August
- 12,139
- 3
- 29
- 30