title: Capture a Screen Shot of UIView - Slow Performance
body: <p>I have a Drawing App of sorts, I would like to create a Snapshot of the Canvas UIView (both on and off screen) and then scale it down. The code I have for doing that take bloody for ever on an iPad 3. Simulator there is no delay.  The Canvas is 2048x2048.</p>
  
  <p>Is there another way I should be doing this? Or something I have a miss in the code?</p>
  
  <p>Thank you!</p>
  
  <pre><code>-(UIImage *) createScreenShotThumbnailWithWidth:(CGFloat)width{
          // Size of our View
      CGSize size = editorContentView.bounds.size;
  
  
          //First Grab our Screen Shot at Full Resolution
      UIGraphicsBeginImageContext(size);
      [editorContentView.layer renderInContext:UIGraphicsGetCurrentContext()];
      UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  
          //Calculate the scal ratio of the image with the width supplied.
      CGFloat ratio = 0;
      if (size.width &gt; size.height) {
          ratio = width / size.width;
      } else {
           ratio = width / size.height;
      }
  
          //Setup our rect to draw the Screen shot into 
      CGSize newSize = CGSizeMake(ratio * size.width, ratio * size.height);
  
          //Send back our screen shot
      return [self imageWithImage:screenShot scaledToSize:newSize];
  
  }
  </code></pre>