问题描述
我正在尝试将视图导出为 UIImage
extension UIImage {
convenience init(view: UIView,originalImageSize: CGSize) {
var campusSize = originalImageSize
var scale : CGFloat = UIScreen.main.scale
UIGraphicsBeginImageContextWithOptions(campusSize,false,scale)
defer {
UIGraphicsEndImageContext()
}
view.drawHierarchy(in: CGRect(x: 0,y: 0,width: imageWidth,height: imageHeight),afterScreenUpdates: true)
let image = UIGraphicsGetImageFromCurrentImageContext()!
self.init(cgImage: image.cgImage!)
}
}
但是导出图像看起来很模糊? 12.9 英寸以下 iPad 出现模糊或数字噪点
我试过了
首先,我尝试了这样的方式,这是框架积分之后的 -> CGRectIntegral what is the usage of it?
editViewContainterViewFrame.integral
它已在 iPhone 设备和 iPad 12.9 英寸设备中修复
问题
问题是在 iPhone 和 iPad 12.9inch 中没有发生 此问题发生在 iPad 12.9 英寸以下的小型 iPad 设备中,例如 11 英寸、10.9 英寸等...
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)