I want to take the screenhot of viewcontroller I had write this:-
- (UIImage *)captureScreenInRectWOScroll:(CGRect)captureFrame {
CALayer *layer;
layer = self.view.layer;
UIGraphicsBeginImageContext(captureFrame.size);
CGContextClipToRect (UIGraphicsGetCurrentContext(),captureFrame);
[layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return screenImage;
}
The way i am calling this method:-
UIImage *img_woscroll1 =[self captureScreenInRectWOScroll:CGRectMake(35,147,497,260)];
I wann to take screenshot of Address from below attached image:-
When i am taking hte screenshot from the above code i Got the image with lot of blank space(greencolor image at top) at top side if image:-
Please help me..How to take proper screenshot from image such that i will not get blank image on topside.