title: saving a section of the screen with screenshot xcode 4.2
body: <p>In my app i have a ui image view with a section removed overlaid on top of another image view so the user can upload a pic from  camera roll and manipulate on screen.  I want to save both these images together  using the following code to take a shot of the screen.  However as that aslo takes the top bar and tab view along the bottom, Is it possible to specify a certain area of the screen to save via a screen shot button?</p>
  
  <p>Can I manipulate the following code so it doesn't take a screen shot with the whole screen so I can leave out the bar buttons?</p>
  
  <pre><code>if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
      UIGraphicsBeginImageContextWithOptions(self.view.window.bounds.size, NO, [UIScreen mainScreen].scale);
  else
      UIGraphicsBeginImageContext(self.view.bounds.size);
  [self.view.window.layer renderInContext:UIGraphicsGetCurrentContext()];
  UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  
  UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);           
  </code></pre>