1

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.

pre
  • 3,475
  • 2
  • 28
  • 43
Isaac Waller
  • 32,709
  • 29
  • 96
  • 107

1 Answers1

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