所有
我需要上传从照片库中拍摄的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
的内存大小。请告诉我。