Ios 使用图像采集器裁剪照片
我想裁剪在应用程序中拍摄的照片,然后保存。我使用的是GKImagePicker,所以我可以这样做,但如果我使用下面的代码,即使我按下应用程序中的拍照按钮,它也会显示我要裁剪的照片库。我不想这样做,只想裁剪我在应用程序中拍摄的照片Ios 使用图像采集器裁剪照片,ios,photo,Ios,Photo,我想裁剪在应用程序中拍摄的照片,然后保存。我使用的是GKImagePicker,所以我可以这样做,但如果我使用下面的代码,即使我按下应用程序中的拍照按钮,它也会显示我要裁剪的照片库。我不想这样做,只想裁剪我在应用程序中拍摄的照片 - (IBAction)takePhoto:(UIButton *)sender { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.de
- (IBAction)takePhoto:(UIButton *)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
self.imagePicker = [[GKImagePicker alloc] init];
self.imagePicker.cropSize = CGSizeMake(320, 320);
self.imagePicker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:self.imagePicker.imagePickerController animated:YES];
[self presentViewController:picker animated:YES completion:NULL];
}
删除代码中的最后一行:
[self presentViewController:picker animated:YES completion:NULL];// remove
试试看;)
您也可以检查。杜德,请您添加更多说明您想做什么,您是否需要在不打开照片库的情况下从摄像头拍摄图像后直接对其进行合并?是的,很抱歉解释太少。拍照后不会进行裁剪。它可以移动,但不能正确缩放