【发布时间】:2017-11-27 12:00:08
【问题描述】:
我只能找到可以获取像素的旧帖子。
(CGImage -> CFData -> UInt8 -> RGBA)
这种方法只能获取像素值。
我想获取和设置 UIImage 或像素缓冲区的像素值。
是否有任何简单或抽象的函数/库可以做到这一点?
【问题讨论】:
标签: ios swift image-processing uiimage uikit
我只能找到可以获取像素的旧帖子。
(CGImage -> CFData -> UInt8 -> RGBA)
这种方法只能获取像素值。
我想获取和设置 UIImage 或像素缓冲区的像素值。
是否有任何简单或抽象的函数/库可以做到这一点?
【问题讨论】:
标签: ios swift image-processing uiimage uikit
let yourImageView: UIImageView = {
let image = UIImage(named: "yourimage")
let imageView = UIImageView(image: image)
imageView.backgroundColor = UIColor.rgb(red: 252, green: 192, blue: 46)
return imageView
}()
//你仍然可以在外面设置它 yourImageView.backgroundColor = UIColor.rgb(red: 252, green: 192, blue: 46)
我希望这会有所帮助?
【讨论】: