Ios 试图将图像调整为缩略图,出现错误“0”;未解析标识符的使用“;对于kCGInterpolationHigh
尝试使用以下代码将图像大小调整为缩略图,出现错误: 未解析标识符的使用 对于Ios 试图将图像调整为缩略图,出现错误“0”;未解析标识符的使用“;对于kCGInterpolationHigh,ios,swift,uiimage,interpolation,Ios,Swift,Uiimage,Interpolation,尝试使用以下代码将图像大小调整为缩略图,出现错误: 未解析标识符的使用 对于kCGInterpolationHigh @IBAction func dropPhoto(sender: AnyObject) { presentViewController(imagePicker, animated: true, completion: nil) } func imagePickerController(picker: UIImagePickerController, didFinishPi
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)
}
}
在iOS 9+中使用
CGInterpolationQuality.High
而不是kCGInterpolationHigh
参考: