本文介绍了如何拍摄清晰的画面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用IOS应用程序,在该应用程序中,我尝试过需要清晰的屏幕截图
I am working on IOS Application in which taking clear screen shot is required I've tried
func captureView() -> UIImage {
//hide controls if needed
let rect: CGRect = self.imageView.frame
UIGraphicsBeginImageContext(rect.size)
let context: CGContextRef = UIGraphicsGetCurrentContext()!
self.view.layer.renderInContext(context)
let img: UIImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return img
}
但是图像质量不好.请为此建议我.
But the quality of image is not good. Please suggest me something for it.
推荐答案
更改行
UIGraphicsBeginImageContext(rect.size)
到
UIGraphicsBeginImageContextWithOptions(rect.size, false, 0.0);
这篇关于如何拍摄清晰的画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!