简体   繁体   English

如何将后置摄像头实时视频提要显示到UIImageView?

[英]How do I display the back camera live video feed to an UIImageView?

I have been messing around with the AVFoundation framework for iPhone, but I can't seem to be able to get the information from the back video camera to display on an UIImageView I have in interface builder. 我一直在使用iPhone的AVFoundation框架,但是我似乎无法从后置摄像头获取信息以显示在界面生成器中的UIImageView上。

This is a single view application. 这是一个单视图应用程序。

I just want to get what the back camera sees displayed on an UIImageView. 我只想让后置摄像头看到的显示在UIImageView上。

Thank you! 谢谢!

You don't need a UIImageView, just a UIView. 您不需要UIImageView,只需一个UIView。

Take a look at AVCaptureSession and AVCaptureDeviceInput in AVFoundation. 看一下AVFoundation中的AVCaptureSession和AVCaptureDeviceInput。 With these you can access the cameras. 有了这些,您可以访问摄像机。

AVCaptureVideoPreviewLayer can be used to draw the camera input to a UIView. AVCaptureVideoPreviewLayer可用于将摄像机输入绘制到UIView。

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

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

Please let me know if you would like any more information! 如果您需要更多信息,请告诉我!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM