title: How to get UIImage of a specific area in current screen ios
body: <p>The following code get UIImage of the current screen:</p>
  
  <pre><code>    UIGraphicsBeginImageContext(self.view.frame.size);
      CGContextRef ctx = UIGraphicsGetCurrentContext();
      [self.view.layer renderInContext:ctx];
      UIImage *backgroundImage = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  </code></pre>
  
  <p>If I have a CGRect rect and I want to get only the UIImage of the current screen in that rect, how can I do?</p>