如何删除iOS上图像的平方比例裁剪

问题描述:

我使用IOS标准图像裁剪功能(移动和缩放)裁剪我的图像,然后将其提交给服务器。如何删除iOS上图像的平方比例裁剪

然而,我认识到所提供的裁剪具有方形比(参见下图)

enter image description here

代码的摘录如下:

//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裁剪框(http://*.com/questions/998706/how-to-change-the-uiimagepickercontroller-crop-frame) – CodaFi 2012-04-13 03:42:59

+0

你是对的CodaFi,这个问题已被询问遍及整个计算器。这个线程也可以是有用的,因为用户建议他的框架:http://*.com/questions/3740253/custom-crop-size-in-uiimagepickercontroller。这里是框架:https://github.com/yogev77/UIImagePickerWithEditor。但我没有使用它,所以我不能对此发表任何意见。 – rdurand 2012-08-21 11:33:28

+0

有你的答案.. http://*.com/questions/9041732/set-dimensions-for-uiimagepickercontroller-move-and-scale-cropbox – 2012-12-21 09:08:49

此库可以帮助您。

https://github.com/gekitz/GKImagePicker

它支持自定义裁剪,它很容易,如果需要用本机选取器集成。

+2

该项目不适用于从相机拍照。它总是去画廊。 – learner 2014-08-05 21:30:01

我认为,这将符合您的目的。您可以更改的限制,只要你想

https://github.com/kishikawakatsumi/PEPhotoCropEditor?source=cc

我认为你需要改变self.imgPicker.allowsEditing = YES;self.imgPicker.allowsEditing = NO;