iPhone iOS 4.3 相机焦点方形 - 可以通过编程方式删除吗?

发布于 2024-10-25 19:14:41 字数 160 浏览 2 评论 0原文

自从我的朋友将他的 iPhone iOS 更新到 4.3 后,每次他用相机拍照时都会出现一个小方块。 我们正在开发一个使用相机的应用程序,并希望删除这个恼人的方块。我在 Apple 的 UIImagePickerController 文档中没有找到任何有关它的信息。 以前的 iOS 版本中不存在该正方形。

Since my friend updated his iPhone iOS to 4.3 there's a small square which appears every time he takes a picture with the camera.
We're developing an app that uses the camera and would like to remove this annoying square. I didn't find anything about it in Apple's UIImagePickerController documentation.
The square didn't exist in former iOS versions.

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

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

发布评论

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

评论(3

红颜悴 2024-11-01 19:14:41

您可能想尝试锁定焦点以禁用自动对焦。这是示例代码:

    NSArray *devices = [AVCaptureDevice devices];
    NSError *error;
    for (AVCaptureDevice *device in devices) {
        if (([device hasMediaType:AVMediaTypeVideo]) && 
            ([device position] == AVCaptureDevicePositionBack) ) {
            [device lockForConfiguration:&error];
             if ([device isFocusModeSupported:AVCaptureFocusModeLocked]) {
             device.focusMode = AVCaptureFocusModeLocked;
             NSLog(@"Focus locked");
             }

            [device unlockForConfiguration];
        }
    }

You may want to try to lock the focus to disable auto-focus. Here is a sample code:

    NSArray *devices = [AVCaptureDevice devices];
    NSError *error;
    for (AVCaptureDevice *device in devices) {
        if (([device hasMediaType:AVMediaTypeVideo]) && 
            ([device position] == AVCaptureDevicePositionBack) ) {
            [device lockForConfiguration:&error];
             if ([device isFocusModeSupported:AVCaptureFocusModeLocked]) {
             device.focusMode = AVCaptureFocusModeLocked;
             NSLog(@"Focus locked");
             }

            [device unlockForConfiguration];
        }
    }
∞琼窗梦回ˉ 2024-11-01 19:14:41

将选择器控制器的 .showsCameraControls 属性设置为 NO 应该会删除焦点方块(在 4.3 之前确实如此,我认为没有任何变化),但缺点是您需要提供自己的控件(拍照等)。我担心要么全有,要么全无!

Setting the .showsCameraControls property of your picker controller to NO should remove the focus square (it did pre 4.3, I don't think anything has changed), but the downside is you'll need to provide your own controls (to take photos, etc). It's all or nothing I'm afraid!

梦屿孤独相伴 2024-11-01 19:14:41

创建自定义叠加层,默认叠加层将不会显示。您可以使您的覆盖层完全为空。

Create a custom overlay and default overlay will not display. You can make your overlay can be completely empty.

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