How use CGImageCreateWithImageInRect for iPhone 4 (HD)?
问题 I use the following code to getting images from the sprite. And it works fine everywhere except the iPhone 4 (HD version). - (UIImage *)croppedImage:(CGRect)rect { CGImageRef image = CGImageCreateWithImageInRect([self CGImage], rect); UIImage *result = [UIImage imageWithCGImage:image]; CGImageRelease(image); return result; } The iPhone 4 automatically load HD version of the image (sprite@2x.png) instead sprite.png. The original image has a scale 2, but the resulting image has a scale 1 and