Wednesday, 14 August 2013

Maintain image resolution in screen grab

Maintain image resolution in screen grab

In my app, the user is able to put stickers on top of a photo. When they
go to save their creation, I do a screen grab and store it in a UIImage:
UIGraphicsBeginImageContextWithOptions(self.mainView.bounds.size, NO,
[UIScreen mainScreen].scale);
[self.mainView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *resultImage = [UIGraphicsGetImageFromCurrentImageContext() retain];
UIGraphicsEndImageContext();
(where self.mainView has a subview UIImageView which holds the photo, and
another subview UIView which holds the stickers).
I am wondering, is it possible to do a screen shot in this manner, and
maintain the resolution of the aforementioned photo?

No comments:

Post a Comment