核心图像已过滤的图像跳出我的UIImageView在iOS 10上
问题描述:
我在iOS 10上应用某些核心图像过滤器时遇到了问题.CICrystallize,CIEdgeWork,CIHexagonalPixellate,CIPointillize应用过滤器时弹出我的UIImageView。核心图像已过滤的图像跳出我的UIImageView在iOS 10上
奇怪的部分之一是inputScale越大,他们离中心越远。奇怪的第二部分是,它只发生iOS 10;他们在iOS 9上都工作得很好。奇怪的是,它只发生在真实的设备上。在iOS 10模拟器上一切正常!
答
找到了解决办法。更换
filteredImage.image = UIImage(CIImage: filteredImageData)
有了这个:
let filteredImageRef = ciContext.createCGImage(filteredImageData, fromRect: filteredImageData.extent)
filteredImage.image = UIImage(CGImage: filteredImageRef!)
你能后重现问题,以便我们可以自己测试所需的最少的代码? – HAS
谢谢HAS。解决了。 :) – MPaulo