I've got a view controller with a button which takes a screenshot of the whole screen when pressed:
@implementation ViewController
-(IBAction)Screenshot {
UIGraphicsBeginImageContext(self.view.bounds.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshotimage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(screenshotimage, nil, nil, nil);
}
@end
The Problem : How should I get a screenshot of a specific part of the screen?
i.e. I need the screenshot to be a specific rectangle in the screen and not the whole screen
Any suggestions ?
Thanks