【发布时间】:2017-01-10 23:30:27
【问题描述】:
这是我的原始代码。
在这种情况下,在 imageview 中显示我的图像。
let cgImge = self.test.image?.cgImage?.copy()
self.test.image = UIImage(cgImage: cgImge!, scale: (self.test.image?.scale)!, orientation: (self.test.image?.imageOrientation)!)
这是我在一个项目过程中的代码。
...
UIGraphicsBeginImageContext((self.test.image?.size)!)
self.test.layer.render(in: UIGraphicsGetCurrentContext()!)
self.test.image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
let cgImge = self.test.image?.cgImage?.copy()
self.test.image = UIImage(cgImage: cgImge!, scale: (self.test.image?.scale)!, orientation: (self.test.image?.imageOrientation)!)
...
但我无法显示我的图像。 我可以做些什么来解决这个问题?
【问题讨论】: