在iPhone上拍照,无需显示控件 [英] Take a picture on iPhone without showing controls

查看:90
本文介绍了在iPhone上拍照,无需显示控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在iPhone上的代码中拍照,而无需通过Apple控件?我已经看到了一堆应用程序这样做,但我不知道什么API调用使用。

Is there a way to take a picture in code on the iPhone without going through the Apple controls? I have seen a bunch of apps that do this, but I'm not sure what API call to use.

推荐答案

有两种方法来做到这一点。一个在iOS 3.0+中可用的是使用 UIImagePickerController 类,将 showsCameraControls 属性设置为NO, cameraOverlayView 属性到您自己的自定义控件。二,在iOS 4.0+中可用的是配置 AVCaptureSession ,使用适当的摄像机设备为其提供 AVCaptureDeviceInput AVCaptureStillImageOutput 。第一种方法更简单,并且在更多的iOS版本上工作,但第二种方法可以更好地控制照片分辨率和文件选项。

Yes, there are two ways to do this. One, available in iOS 3.0+ is to use the UIImagePickerController class, setting the showsCameraControls property to NO, and setting the cameraOverlayView property to your own custom controls. Two, available in iOS 4.0+ is to configure an AVCaptureSession, providing it with an AVCaptureDeviceInput using the appropriate camera device, and AVCaptureStillImageOutput. The first approach is much simpler, and works on more iOS version, but the second approach gives you much greater control over photo resolution and file options.

这篇关于在iPhone上拍照,无需显示控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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