UIImagePickerController - crops picture to square (in portrait)

后端 未结 3 1151
被撕碎了的回忆
被撕碎了的回忆 2021-02-05 09:28

I\'m using the UIImagePickerController to take and edit a picture. it works fine in landscape, but in portrait it will crop the picture into a square (does not allow to reduce t

相关标签:
3条回答
  • 2021-02-05 10:05

    You can provide a custom cropping UI, but there is no way to change just the cropping rectangle of the standard one.

    This link might help with that.

    0 讨论(0)
  • 2021-02-05 10:26

    I know its really late to answer this question, But someone may find this helpful.

    Change

    [imagePicker setAllowsEditing:YES]; 
    

    To

    [imagePicker setAllowsEditing:NO];
    

    Thanks, Jay

    0 讨论(0)
  • 2021-02-05 10:27

    Check out GKImagePicker library, it allows to set your custom image crop area, like this:

    self.imagePicker = [[GKImagePicker alloc] init];
    self.imagePicker.cropSize = CGSizeMake(320, 90);
    self.imagePicker.delegate = self;
    
    [self presentModalViewController:self.imagePicker.imagePickerController animated:YES];
    
    0 讨论(0)
提交回复
热议问题