I am using the following code to capture a UIView as a UIImage and save it in Docs Dir.
- (UIImage *) imageWithView:(UIView *)view
{
UIGraphicsBeginImageContext(view.bounds.size);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
The UIImage is successfully saved. However the resolution is very poor. See the image below for reference. How do I make sure the resolution is retained as per the original image?