How to draw on top of camera preview?

假装没事ソ 提交于 2019-12-10 11:53:46

问题


I want to draw some thing on the view which we get when our camera is on in android mobile.

I do not want to take picture nor record video just that view from camera and then draw some thing on screen.

Drawing on screen is will not be issue but when we turn on camera which view we get and how can we use that view in our application?


回答1:


You'll want to check androids camera-API.

You can get the preview to display in a SurfaceView or your own View-subclass, which can then be used to draw on. Some more knowledge might be found here.




回答2:


You can use a RelativeLayout to put other views aligned with the surfaceView used for camera preview



来源:https://stackoverflow.com/questions/7294748/how-to-draw-on-top-of-camera-preview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!