UIGraphicsBeginImageContext(self.bounds.size );
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *currentScreen = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
here am unable get the screenshot of updated scratchpad something done on scratchpad but it not showing in my screenshot ![Scratchpad screenshot][1]
Try something like this , if you consider to take a screenshot of UIView or UIImageView
.
UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, YES, 1.0);// Add your view / ScratchPadView whichever you want to take Snap
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
[[UIColor redColor] set];
NSData *imgData = UIImageJPEGRepresentation(image, 1.0);
UIGraphicsEndImageContext();