如何在IOS上取消图片的正方形裁剪比例

12

我正在使用IOS标准图像裁剪功能(移动和缩放)在提交图像到服务器之前对其进行裁剪。

然而,我意识到提供的裁剪是一个正方形比例(见下面的截图)

输入图像描述

以下是代码片段:

//set up image picker
self.imgPicker = [[[UIImagePickerController alloc] init]autorelease];
self.imgPicker.allowsEditing = YES;
self.imgPicker.delegate = self;

//Trigger get photo from library function
self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:self.imgPicker animated:YES];

如何在允许用户进行“移动和缩放”编辑的同时,允许用户进行裁剪而不受正方形比例限制?


2
可能是如何更改UIImagePickerController裁剪框架的重复问题。 - CodaFi
你说得对,CodaFi。这个问题已经在stackoverflow上被问了很多次。这个线程也可能有用,因为一个用户建议他的框架:https://dev59.com/tFDTa4cB1Zd3GeqPKI5R。这是框架:https://github.com/yogev77/UIImagePickerWithEditor。但我没有使用过它,所以我不能给出任何意见。 - rdurand
这是你要找的答案:https://dev59.com/Z2ox5IYBdhLWcg3wr2Po - metinn
3个回答

15

我认为您需要将self.imgPicker.allowsEditing = YES;更改为self.imgPicker.allowsEditing = NO;


3

2
该项目无法从相机拍摄照片,它总是跳转到相册。 - learner

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接