这是我的代码,在我的应用程序中拍摄部分屏幕截图!屏幕截图的大小正是我想要的,但是当我在相机胶卷中拉起它时,图像看起来并不重要,而不是我想要的质量。我写的代码有什么问题?为什么我的部分屏幕快照模糊不清?
@IBAction func screenShotButton(sender: Any Object) {
let top: CGFloat = 196
let bottom: CGFloat = 197
let size = CGSize(width: view.frame.size.width, height: view.frame.size.height - top - bottom)
UIGraphicsBeginImageContext(size)
let context = UIGraphicsGetCurrentContext()!
CGContextTranslateCTM(context, 0, -top)
view.layer.renderInContext(context)
let snapshot = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
UIImageWriteToSavedPhotosAlbum(snapshot, nil, nil, nil)
}
你能告诉我们一个模糊截图的例子吗? – mech