尝试使用以下代码将图像调整为缩略图,收到错误:
使用未解析的标识符
代表kCGInterpolationHigh
@IBAction func dropPhoto(sender: AnyObject) {
presentViewController(imagePicker, animated: true, completion: nil)
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage, editingInfo: [String : AnyObject]?) {
self.dismissViewControllerAnimated(true, completion: nil)
let thumbnail = image.resizedImageWithContentMode(UIViewContentMode.ScaleAspectFit, bounds: CGSizeMake(400, 400), interpolationQuality: kCGInterpolationHigh)
let imgData = UIImagePNGRepresentation(thumbnail)
}
}
答案 0 :(得分:3)
在iOS 9 +中使用CGInterpolationQuality.High
代替kCGInterpolationHigh
。