UIGraphicsGetImageFromCurrentImageContext gives poor quality / low resolution image, how do I get be
- by user157733
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 :-)