可以看下这个链接：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.
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.
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:
Output in console:image height = 31.000000 (CGImage = 62)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?Yes.
Alternatively, you can u