【问题标题】:Capture the preview of a UIImagePickerController捕获 UIImagePickerController 的预览
【发布时间】:2009-12-01 16:25:44
【问题描述】:

这个问题已经被问过很多次了。但大多数答案不适用于最新的操作系统(3.0+),或者是“Apple 将拒绝它”。

我需要以编程方式抓取 UIImagePickerController 预览中显示的图像,而无需用户拍照并使用该图像 - 我真正需要的是获取我的应用程序的屏幕截图,其中包含背景和前景中的其他内容。

我尝试了几种方法,最新的是:遍历 UIImagePickerController.view 的所有子视图并使用[view.layer renderInContext:] 方法将它们保存为图像。使用这种方法,我实际上可以获得所有控制器的资产(按钮等),但我永远看不到实际的预览。有没有人想办法在 3.0+ 中做到这一点?

【问题讨论】:

    标签: iphone objective-c camera screenshot uiimagepickercontroller


    【解决方案1】:

    question 1317978 已经回答了这个问题。另外,看看the blog post describing live grabbing in sudoku solver

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多