如何在基于 UIImagePicker 的应用程序中实现相机曝光控制?

发布于 2024-09-25 17:06:47 字数 465 浏览 2 评论 0原文

我有一个基于 UIImagePicker 的应用程序,它通过自定义覆盖层控制相机来处理平视显示以及数字缩放。

我想像普通 iPhone 相机应用程序一样添加“触摸调整曝光”。当您放大时,您最终希望根据“大图片视图”以外的其他内容来更改曝光。

UIImagePicker 似乎没有工具可以做到这一点......它都是自动的。如果我使用自定义叠加层,UIImagePicker 将忽略触摸事件。

我尝试对 UIImagePicker 进行子类化,并在触摸事件出现后将其传递给 Super...但不走运。

我目前正在研究 AVFoundation 框架,因为它的 AVCaptureSession 支持基于点设置曝光。我可以扔掉现有的代码并用这些工具替换它,但在这样做之前我想我会问我是否缺少一个更简单的选项。

是的,我知道 WWDC 关于 AVFoundation 的教程。如果调整 UIImagePicker 是不可能的,我会走这条路。

I have a UIImagePicker based app that controls the camera with custom overlays to handle a heads up display as well as digital zooming.

I would like to add "touch to adjust exposure" like the normal iPhone camera app has. When you zoom in, you ultimately want to change exposure based on something other than "the big picture view".

UIImagePicker seems to have no tools for doing this... it's all automatic. If I use my custom overlay, the touch events are disregarded by the UIImagePicker.

I've attempted to subclass the UIImagePicker and pass my touch events to Super after they come along... no luck.

I'm currently looking at the AVFoundation framework as it's AVCaptureSession supports setting exposure based on a point. I could toss my existing code and replace it with these tools, but before I do that I thought I'd ask if I was missing a simpler option.

Yes, I know about the WWDC's tutorials on AVFoundation. I'll go that route if tweaking UIImagePicker is out of the question.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

终止放荡 2024-10-02 17:06:47

从 iOS 4.3 开始,Apple 现在将触摸事件传递到相应的相机控制器。
结果是曝光和对焦控件现在响应自定义叠加层上的触摸事件。这太棒了;谢谢苹果。有趣的是,我在任何发行说明或文档中都找不到对此新功能的引用。

As of iOS 4.3, Apple is now passing touch events along to the appropriate camera controllers.
The result is that exposure and focus controls now respond to touch events on your custom overlay. This is fantastic; thank you Apple. Interestingly, I can find no reference to this new functionality in any of the release notes or documentation.

流年已逝 2024-10-02 17:06:47

UIImagePickerController 不提供曝光控制。您需要使用 AVFoundation。

UIImagePickerController doesn't provide exposure control. You need to use AVFoundation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文