title: Must I multiply the scale with the point values for retina display, in this case?
body: <p>Since the retina display, suddenly this piece of drawing code seems to not work anymore. The drawn image is slightly offset than it was before and appears somewhat stretched.</p>
  
  <p>I am drawing something in the -drawRect: method of an UIControl subclass. I figured out that the current scale inside that UIControl indeed is 2.0. This code obtains an CGImage from an UIImage, which probably won't know anything about the scale. It's feeded as parameter to an method that also takes some point values right now.</p>
  
  <pre><code>CGContextDrawImage(context, CGRectMake(drawingRect.origin.x, drawingRect.origin.y, img.size.width, img.size.height), [img CGImage]);
  </code></pre>
  
  <p>Note: drawingRect is in points. img.size.width inside an NSLog does output the correct value in points, while [img CGImage] does output the @2x image for retina display. I did a check to verify this:</p>
  
  <pre><code>NSLog(@"image height = %f (CGImage = %d)", img.size.height, CGImageGetHeight([img CGImage]));
  </code></pre>
  
  <p>Output in console: <code>image height = 31.000000 (CGImage = 62)</code></p>
  
  <p>How would I deal with the @2x image here? Must I multiply every value with the scale, manually? But that would also screw up the actual visible rectangle on the screen, or not?</p>