【发布时间】:2012-05-01 15:09:51
【问题描述】:
我想从 UIImagepicker 中挑选一张图片,相机胶卷中有 PNG 和 JPG 格式。
我需要将其转换为 NSData。但是我需要知道这张图片是UIImageJPEGRepresentation 还是UIImagePNGRepresentation,以便我可以转换它。
UIImage *orginalImage = [info objectForKey:UIImagePickerControllerOriginalImage];
[picker dismissViewControllerAnimated:YES completion:nil];
NSData *orgData = UIImagePNGRepresentation(orginalImage);
【问题讨论】:
标签: iphone ios xcode uiimagejpegrepresentation uiimagepngrepresentation