title: Getting a screenshot of a UIScrollView, including offscreen parts
body: <p>I have a <code>UIScrollView</code> decendent that implements a takeScreenshot method that looks like this:</p>
  
  <pre><code>-(void)takeScreenshot {  
    CGRect contextRect  = CGRectMake(0, 0, 768, 1004);
    UIGraphicsBeginImageContext(contextRect.size);    
    [self.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
  
    // do something with the viewImage here.
  }
  </code></pre>
  
  <p>This basically moves to the top of the scroll view, and takes a screenshot of the visible area. It works fine when the iPad is oriented portrait, but when it's in landscape the bottom of the image is cut off (as the height of the visible area is only 748, not 1004).</p>
  
  <p>Is it possible to get a snapshot of the <code>UIScrollView</code>, including areas not on screen? Or do I need to scroll the view down, take a second photo and stitch them together?</p>