iPhone iOS 4.3 相机对焦方块 - 可通过编程方式移除? [英] IPhone iOS 4.3 camera focus square - removeable programmatically?

查看:18
本文介绍了iPhone iOS 4.3 相机对焦方块 - 可通过编程方式移除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我的朋友将他的 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.

推荐答案

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

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

这篇关于iPhone iOS 4.3 相机对焦方块 - 可通过编程方式移除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆