【问题标题】:How to perform an action only when capture is done in iphone image-Picker when ever click the capture button仅当在 iphone image-Picker 中完成捕获时单击捕获按钮时如何执行操作
【发布时间】:2012-10-30 05:41:25
【问题描述】:

在我的 iPhone 应用中,我有 捕获图像 功能并可以编辑捕获的图像。

我的意图是在图像选择器上添加一个叠加层,以直观地改变裁剪矩形的尺寸[我稍后会为此烦恼]

当图像选择器打开时,视图如下所示:

我需要知道用户何时点击该捕获按钮

我需要执行一些操作当用户点击捕获按钮时 (but not when the image picker appears / dismiss) just before use the image by click on use

至少打印日志声明 NSLog(@" Capture Clicked");

【问题讨论】:

  • 哥们找到解决办法了吗
  • 你找到解决方案了吗?

标签: iphone objective-c ios ipad uiimagepickercontroller


【解决方案1】:

假设您使用的是 UIImagePickerController。下面的方法将在用户选择/捕获图像后调用

   - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
    {
        selectedImage =  [info objectForKey:UIImagePickerControllerEditedImage];
        [self editImage:selectedImage];
        //dismiss the picker
        [picker dismissModalViewControllerAnimated:YES];

    }

当然,如果您的图像处理方法需要很长时间才能返回,这会使您的应用程序无法响应。

【讨论】:

  • 此方法调用时选择器视图关闭.....我需要在关闭之前执行操作(在 USE 捕获的图像之前)...任何快速的方法回复@ Mahesh & @ janusfidel
猜你喜欢
  • 2011-06-25
  • 2015-06-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-24
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多