iOS 开发 : What does "original" mean in UIImagePickerControllerOriginalImage?

标签 ios

我已经学习了tutorial iOS 应用程序开发。在“使用 View Controller ”部分,它教我如何实现函数来处理用户选取图像的事件:

func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
        // The info dictionary contains multiple representation of the image, and this uses original
        let selectedImage = info[UIImagePickerControllerOriginalImage] as! UIImage

        // Set PhotoImageView to display the selected image
        photoImageView.image = selectedImage

        // Dismiss the picker
        dismissViewControllerAnimated(true, completion: nil)
    }

我无法理解“let selectedImage = ...”行的含义,特别是 UIImagePickerControllerOriginalImage 部分。教程的解释是:

The info dictionary contains the original image that was selected in the picker, and the edited version of that image, if one exists. To keep things simple, you’ll use the original, unedited image for the meal photo.

那么,什么是“原创”和“编辑”?有什么区别?

最佳答案

UIImagePickerController 有一个 allowsEditing 属性,当设置为 true 时,允许用户编辑静态图像或电影。

因此,UIImagePickerControllerOriginalImageUIImagePickerControllerEditedImage 是有意义的,因为它们代表 2 个不同的图像,一个是原始图像,另一个是用户编辑过的图像。

关于iOS 开发 : What does "original" mean in UIImagePickerControllerOriginalImage?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37549820/

相关文章:

android - Xamarin.Forms 相机控制访问 DependencyService

iphone - ios 多级首选项 Pane

ios - iOS下使用Stitcher时OpenCV编译报错

ios - Xcode7 核心绘图错误 : CPTPlot, NSString

ios - Base64 图像损坏 ios

ios - Tableview 未加载/触发

ios - 使用搜索栏在 Core Data 中搜索 NSSet 属性

ios - 如何删除以 NSLog iOS 开头的行?

ios - 如何检查每两张翻转卡片的数组中按钮的当前标题是否在卡片匹配游戏中匹配

ios - parse.com的缓存策略