UIGraphicsGetImageFromCurrentImageContext gives poor quality / low resolution image, how do I get be

Posted by user157733 on Stack Overflow See other posts from Stack Overflow or by user157733
Published on 2010-04-16T13:31:47Z Indexed on 2010/04/18 8:23 UTC
Read the original article Hit count: 749

Filed under:
|
|
|
|

Ok so I am taking a screen shot of a photo I took with my camera on the iPhone. I put the camera photo into UIImageView and grab a screenshot of it using this sort of code (this is from http://www.skylarcantu.com/blog/2009/10/16/saving-a-view-as-an-image/)...

 - (void)takeScreenshot {

    UIWindow *theScreen = [[UIApplication sharedApplication].windows objectAtIndex:0];     
    UIGraphicsBeginImageContext(theScreen.frame.size);  
    [[theScreen layer] renderInContext:UIGraphicsGetCurrentContext()];   
    UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();    
    UIGraphicsEndImageContext();              
    [self doSomethingWith:screenshot]; 
}

I have it working as I want but the image quality of the screenshot is much worse than the image I take with my camera. Is there a way to overcome this? I guess it is because this takes a screenshot which captures the resolution of the iPhone screen rather than the resolution of the camera - maybe?!

Any suggestions would be great :-)

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk