Take screenshot from UIVIEW+ipad
<p>I want to take the screenhot of viewcontroller
I had write this:-</p>

<pre><code>- (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; 
}
</code></pre>

<p>The way i am calling this method:-</p>

<pre><code>UIImage *img_woscroll1 =[self captureScreenInRectWOScroll:CGRectMake(35,147,497,260)];
</code></pre>

<p>I wann to take screenshot of Address from below attached image:-
<img src="http://i.stack.imgur.com/9UL3k.png" alt="enter image description here"></p>

<p>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:-</p>

<p><img src="http://i.stack.imgur.com/etDF0.png" alt="enter image description here"></p>

<p>Please help me..How to take proper screenshot from image such that i will not get blank image on topside.</p>
