如何在从iPhone上拍照时上传时减少UII图像尺寸

时间:2015-05-13 10:02:37

标签: ios uiimage uiimagepickercontroller

所有

我需要上传从照片库中拍摄的UIImage或从相机拍摄的照片,

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info  
{

UIImage *chosenImage = info[UIImagePickerControllerEditedImage];

NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:chosenImage,@"chosenImage", nil];

UIImage* selectedImage = [userInfo objectForKey:@"chosenImage"]

NSData *imageData = UIImagePNGRepresentation(selectedImage);

}

我正在使用imageData将其上传到服务器上,我想知道有没有办法在不改变质量的情况下减少UIImage的内存大小。请告诉我。

0 个答案:

没有答案