我想得到图像frm imagepickercontroller.But我的代码没有任何影响
这是代码..
这是代码..
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; imageview.image = [UIImage imageNamed:[info objectForKey:@"UIImagePickerControllerOriginalImage"]];
解决方法
您可以尝试使用此代码来访问从选择器返回的Image
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; UIImage* originalImage = nil; originalImage = [info objectForKey:UIImagePickerControllerEditedImage]; if(originalImage==nil) { originalImage = [info objectForKey:UIImagePickerControllerOriginalImage]; } if(originalImage==nil) { originalImage = [info objectForKey:UIImagePickerControllerCropRect]; } //At this point you have the selected image in originalImage [self saveImageToDocumentDirectory:originalImage]; }