【问题标题】:Core Image Filtered image jumps out of my UIImageView on iOS 10Core Image Filtered 图像在 iOS 10 上跳出我的 UIImageView
【发布时间】:2017-01-25 02:41:54
【问题描述】:

我在 iOS 10 上应用某些核心图像过滤器时遇到问题。应用过滤器时,CICrystallize、CIEdgeWork、CIHexagonalPixellate、CIPointillize 等过滤器会跳出我的 UIImageView。

奇怪的第一部分是 inputScale 越大,它们越远离中心。奇怪的第二部分是它只发生在 iOS 10 上;他们都在 iOS 9 上运行良好。奇怪的第三部分是它只发生在真实设备上;在 iOS 10 模拟器上一切正常!

【问题讨论】:

  • 您能否发布重现问题所需的最少代码,以便我们自己进行测试?
  • 谢谢。解决了。 :)

标签: swift core-image ios10 cifilter cikernel


【解决方案1】:

找到了解决办法。替换了

filteredImage.image = UIImage(CIImage: filteredImageData)

有了这个:

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

【讨论】:

    猜你喜欢
    • 2018-03-03
    • 1970-01-01
    • 2016-12-22
    • 2016-12-07
    • 1970-01-01
    • 2014-12-19
    • 2012-09-25
    • 2017-07-04
    • 2019-03-07
    相关资源
    最近更新 更多