Wednesday, 7 August 2013

How to make the CGImage resolution dependence?

How to make the CGImage resolution dependence?

I want to crop an Image, so, I google, and find this article:
http://iosdevelopertips.com/graphics/how-to-crop-an-image.html
But the problem is in this line:
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], rect);
I realize that the if the image is on non-retina display, it cut
perfectly, but if there is on an retina device, the rect's frame's width
and height need to multiple 2. But the question is, how can I make it more
generic? (I don't want to detect device) Thanks.

No comments:

Post a Comment