gpt4 book ai didi

ios - 如果 allowsEditing=NO,选择器不会返回任何图像

转载 作者:行者123 更新时间:2023-11-28 18:23:20 28 4
gpt4 key购买 nike

如题所示,如果我设置

imagePickerController.allowsEditing = YES;

imagePickerController.allowsEditing = NO

我没有返回图像?我已经搜索过,但找不到明确的答案

    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePicker.delegate = self;
imagePicker.allowsEditing = NO;
[self.editController presentModalViewController:imagePicker animated:YES];


- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
DebugLog(@"info dict: %@", info);
[picker dismissModalViewControllerAnimated:YES];
UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
self.schemeLogo.backgroundColor = [UIColor whiteColor];
self.schemeLogo.image = image;
NSData *imageData1 = UIImagePNGRepresentation(image);
NSString *path1 = [ICUtils pathForDocument:@"schemeLogo.png"];
[imageData1 writeToFile:path1 atomically:NO];
}

最佳答案

固定的,需要的

[info objectForKey:UIImagePickerControllerOriginalImage];

关于ios - 如果 allowsEditing=NO,选择器不会返回任何图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16277489/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com