作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
尝试使用以下代码将图像调整为缩略图,出现错误:
Use of unresolved identifier
对于 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
。
关于ios - 尝试将图像调整为缩略图,kCGInterpolationHigh 出现错误 "Use of unresolved identifier",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35687871/
我有一个具有可变数量子元素的固定大小的 div。我不知道 children 的大小。目标是缩小它们以适合父级。 例子: .parent { width: 100px; height: 100p
我是一名优秀的程序员,十分优秀!