【问题标题】:Using GKImagePicker to crop photo使用 GKImagePicker 裁剪照片
【发布时间】:2013-07-25 09:17:45
【问题描述】:

我想裁剪在应用中拍摄的照片,然后保存。我正在使用 GKImagePicker 以便我可以做到这一点,但是如果我使用下面的代码,即使我在我的应用程序中按下拍照按钮,它也会向我显示我选择裁剪的照片库。我不想这样做,只想裁剪我在应用程序中拍摄的照片。

- (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];

}

【问题讨论】:

  • 哥们,你能不能多解释一下你想做什么,你需要在不打开照片库的情况下直接从Cam中获取图像吗?
  • 是的,抱歉解释少了..

标签: ios photo


【解决方案1】:

删除代码中的最后一行:

[self presentViewController:picker animated:YES completion:NULL];// remove

试一试;)

您也可以查看this。

【讨论】:

  • 拍照后不裁剪。它会移动,但无法正确缩放
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-06-14
  • 2015-03-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-03-22
  • 1970-01-01
相关资源
最近更新 更多