相关疑难解决方法(0)

didFinishPickingMediaWithInfo返回零照片

我正在努力捕获使用4.0返回的图像

- (void)imagePickerController:(UIImagePickerController *)picker 
    didFinishPickingMediaWithInfo:(NSDictionary *)info
{
    [[picker parentViewController] dismissModalViewControllerAnimated:YES]; 

    // MediaType can be kUTTypeImage or kUTTypeMovie. If it's a movie then you
    // can get the URL to the actual file itself. This example only looks for images.
    //   
    NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType];
    // NSString* videoUrl = [info objectForKey:UIImagePickerControllerMediaURL];

    // Try getting the edited image first. If it doesn't exist then you get the
    // original image.
    //
    if (CFStringCompare((CFStringRef) mediaType,  kUTTypeImage, 0) == kCFCompareEqualTo) {               
        UIImage* picture …
Run Code Online (Sandbox Code Playgroud)

iphone camera uiimagepickercontroller uiimage

30
推荐指数
3
解决办法
4万
查看次数

带allowEditing的UIImagePickerController不允许平移裁剪

我在这里看到了这个问题:UIImagePicker允许编辑卡在中心

似乎以前有人遇到过这个问题,但是没有明确的解决方案.

复制步骤:

  1. 设置allowEditing = YES
  2. 拍张照片
  3. 裁剪窗口出现,但每次我平移图像时,它都会快速回到中心.

我在iOS 7.0.3上.

这是我的代码:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];

imagePicker.delegate = self;
imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext;
imagePicker.allowsEditing = YES;
[self presentViewController:imagePicker animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

uiimagepickercontroller ios ios7

20
推荐指数
1
解决办法
4896
查看次数

UIImagePickerController裁剪?

我已经读过它是自动的,但在我的情况下似乎没有发生.使用UImagePickerController并将allowEditing设置为YES我使用裁剪方形叠加获得我的编辑视图,但是当我完成图像时,它没有像我期望的那样被裁剪.

它应该在这个阶段自动吗?如果没有,那么在默认视图提供的匹配区域中裁剪图像可能是一个很好的解决方案?

谢谢.

crop objective-c uiimagepickercontroller ios

5
推荐指数
1
解决办法
4356
查看次数