简体   繁体   English

您可以显示设备摄像头的实时输出吗?

[英]Can you display the real-time output of the device's camera?

I am wondering if it is possible to show the output of the camera running on your device immediately on the screen. 我想知道是否可以在屏幕上立即显示设备上运行的摄像机的输出。 Just like the native camera app does. 就像本机相机应用程序一样。

I have to show the picture, that comes into the camera lens, and additionally add some graphics overlays. 我必须显示相机镜头中的图片,并另外添加一些图形叠加层。 That's why I guess, starting an Intent to open the camera activity is not suitable. 这就是为什么我认为启动Intent打开相机活动是不合适的。

I've found some SO Threads, Tutorials and documentation about using the Android Camera API, but they are all able to just take a picture and display it afterwards. 我已经找到了一些有关使用Android Camera API的SO线程,教程和文档,但是它们都能够拍照并随后显示。

Is it possible at all? 有可能吗?

Refer to this link Camera Tutorial for Android (using surfaceview) ! 请参阅此链接Android相机教程(使用Surfaceview)

Use the SurfaceView to preview the camera output, then, you can add your graphics overlays as you wish. 使用SurfaceView预览相机输出,然后,您可以根据需要添加图形叠加层。

Hope this helps :) 希望这可以帮助 :)

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

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