2016-09-16 41 views
0

我在iOS 10上應用某些核心圖像過濾器時遇到了問題.CICrystallize,CIEdgeWork,CIHexagonalPixellate,CIPointillize應用過濾器時彈出我的UIImageView。核心圖像已過濾的圖像跳出我的UIImageView在iOS 10上

奇怪的部分之一是inputScale越大,他們離中心越遠。奇怪的第二部分是,它只發生iOS 10;他們在iOS 9上都工作得很好。奇怪的是,它只發生在真實的設備上。在iOS 10模擬器上一切正常!

+0

你能後重現問題,以便我們可以自己測試所需的最少的代碼? – HAS

+1

謝謝HAS。解決了。 :) – MPaulo

回答

0

找到了解決辦法。更換

filteredImage.image = UIImage(CIImage: filteredImageData) 

有了這個:

let filteredImageRef = ciContext.createCGImage(filteredImageData, fromRect: filteredImageData.extent) 
filteredImage.image = UIImage(CGImage: filteredImageRef!)