【发布时间】:2018-08-30 13:21:27
【问题描述】:
我正在使用 UIGraphicsBeginImageContextWithOptions 和自定义 CGSize 我不知道为什么我得到拉伸图像?
UIGraphicsBeginImageContextWithOptions(CGSize(width: UIScreen.main.bounds.width, height: 200) , false, 0)
let cellRect = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 200)
view.drawHierarchy(in: cellRect, afterScreenUpdates: true)
let wholeImage = UIGraphicsGetImageFromCurrentImageContext()//stretched image
UIGraphicsEndImageContext()
【问题讨论】:
-
您能附上“拉伸图像”吗?您是否在“照片”应用中看到它被拉伸了?或在您的应用程序的其他地方? (似乎你在代码方面做的一切都是正确的)