【发布时间】:2015-03-15 15:13:42
【问题描述】:
我正在学习 Swift,我正在创建一个应用程序,该应用程序使用个人照片并在其上放置另一张照片。我现在有一个 hacky 解决方案,创建该区域的屏幕截图并保存它。我需要在 Swift 中执行此操作
@IBAction func saveImage(sender: AnyObject) {
//Create the UIImage
UIGraphicsBeginImageContext(imageView.frame.size)
view.layer.renderInContext(UIGraphicsGetCurrentContext())
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
//Save it to the camera roll
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
}
但是,这是有效的,现在不再有效。但是,这也不是最好的解决方案。
各位,我怎样才能将个人图像中的图像保存到相机胶卷中,并将图像作为叠加层?
我们将不胜感激!谢谢!
【问题讨论】:
-
blend two uiimages 的可能重复项