I need capture specific UIView , but the result is in low quality how can fix this and increase the quality ?
UIGraphicsBeginImageContext(captureView.bounds.size);
[captureView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext();
UIImageWriteToSavedPhotosAlbum(screenshot, nil, nil, nil);
UIGraphicsEndImageContext();
I guess you need a capture a UIView/UIWindow in retina resolution (960×640 or 2048×1536) Using UIGraphicsBeginImageContextWithOptions and set its scale parameter 0.0f makes it capture in native resolution (retina for iPhone 4 and later or iPad 3).
This code capture your UIView in native resolution
This one does the same for full screen (key window)
This saves the UIImage in jpg format with 95% quality in the app’s document folder