Search code examples
uiviewiphone-4screen-capture

UIGetScreenImage() crops on iPhone 4


UIGetScreenImage() works fine on my app on iPhone 3 (3G, GS) but on iPhone 4 it seems to get only a cropped area (upper left). I use UIGetScreenImage() to capture a frame from the camera.

Here is some code

CGImageRef iref =  UIGetScreenImage();
UIImage *tmpImage = [[UIImage alloc] initWithCGImage:iref];

And afterwards I save it to photo album successfully. Any ideas?


Solution

  • its because of the double resolution of the retina screen, you are getting a quarter of the screen I imagine.

    Read this, explains exactly what you have to do :)

    http://developer.apple.com/library/ios/#qa/qa1703/_index.html