如何将后置摄像头实时视频馈送显示到UIImageView



我一直在摆弄iPhone的AVFoundation框架,但我似乎无法从背面摄像机获得信息,以便在界面构建器中的UIImageView上显示。

这是一个单视图应用程序。

我只想在UIImageView上显示背面摄像头看到的内容。

谢谢!

您不需要UIImageView,只需要一个UIView。

查看AVFoundation中的AVCaptureSession和AVCaptureDeviceInput。有了这些,你就可以访问摄像头。

AVCaptureVideoPreviewLayer可用于将相机输入绘制到UIView。

http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVCaptureVideoPreviewLayer_Class/Reference/Reference.html

希望这能回答您的问题:http://www.ios-developer.net/iphone-ipad-programmer/development/camera/camera-preview-on-a-view-controller

如果你想了解更多信息,请告诉我!

最新更新