【问题标题】:crop an image getting error裁剪图像出现错误
【发布时间】:2017-05-23 12:37:05
【问题描述】:

我正在尝试在我的 Xcode 项目中实现一个裁剪窗格。

我收到此错误,我不知道为什么。

谁能帮忙。

   let imageRef = imageToCrop!.cgImage!.cropping(to: visibleRect)
    let result = UIImage(CGImage: imageRef!, scale: imageToCrop!.scale,
        orientation: imageToCrop!.imageOrientation)

    return result
}

但出现此错误

'init(CGImage:scale:orientation:)'的模糊使用

【问题讨论】:

    标签: swift xcode cocoapods crop


    【解决方案1】:

    这是init(cgImage:scale:orientation:) 而不是init(CGImage:scale:orientation:)

    let result = UIImage(cgImage: imageRef!, scale: imageToCrop!.scale, orientation: imageToCrop!.imageOrientation)
    

    【讨论】:

    • 您应该投票结束这个问题,因为这是一个错字或无法再复制的问题。
    猜你喜欢
    • 2016-08-28
    • 1970-01-01
    • 1970-01-01
    • 2014-12-26
    • 2012-06-04
    • 1970-01-01
    • 1970-01-01
    • 2011-10-20
    • 1970-01-01
    相关资源
    最近更新 更多