title: How to clip image in scale in iPhone?
body: <p>I have a large sized image (2048*2048px), this image is shown as 320*320 on iPhone screen. I want to do this:</p>
  
  <p>In my APP, user can open large sized image(e.g. 2048*2048), the image is shown as 320*320 on iPhone screen, and there is rectangle over the image, user can move the rectangle anywhere within image on iPhone screen, e.g. rectangle(100, 100, 300, 200), then I want to clip the original sized image within the rectangle area in scale. </p>
  
  <p>I tried many ways,</p>
  
  <pre><code>UIImageView *originalImageView = [[UIImage View alloc] initWithImage:originalImage]];
  
  CGRect rect = CGRectMake(100, 100, 300, 200);
  
  UIImage *cropImage = [UIImage imageWithCGImage:CGImageCreateWithImageInRect([originalImageView.image CGImage], rect)];
  </code></pre>
  
  <p>But I got the cropImage is just 300*200 sized image, not scale properly.</p>