0

在我的iPhone 应用程序中,我添加了照片选项,因为我from library as well as captured images还添加了照片..

当我打开图像选择器以添加/捕获图像时,它只会显示重拍和使用照片。

当我点击使用时,它在图像视图中显示为图像

i need to display my selected crop,就像在 iphone 的联系人应用程序中添加照片一样

我是按组做的self.imagePickerController.allowsEditing = YES;

但是每当我想编辑图像时,我需要取回原始图像而不是图像选择器中的缩放/裁剪图像以再次编辑

4

1 回答 1

1

您必须将 UIImagePickerController 的 allowEditing 设置为 YES,尝试以下操作:

- (IBAction)takePicture:(id)sender {
UIImagePickerController *imagePicer = [[UIImagePickerController alloc] init];
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
    [imagePicer setSourceType:UIImagePickerControllerSourceTypeCamera];
} else {
    [imagePicer setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
}

// This will sets the editing mode after taking of picking image from image picker

[imagePicer setAllowsEditing:YES];
[imagePicer setDelegate:self];

//place image picker on the screen
[self presentViewController:imagePicer animated:YES completion:nil];
}

如果要使用编辑后的图片,请将“UIImagePickerControllerOriginalImage”改为“UIImagePickerControllerEditedImage”,就可以了!!

于 2012-10-29T07:41:18.313 回答