android show rectangle on camera

北城余情 提交于 2020-01-22 10:33:12

问题


Hi I want to show a rectangle in camera so that when the user takes snap only the region inside the rectangle can be processed. Any idea how can I do it? And the rectangle size can be resized by dragging along the corners.

I am not calling the camera application. I am using the camera API.


回答1:


Hi I solved the problem using this tutorial, see here If the link goes missing some day I have kept a pdf here




回答2:


You can see my open source application http://code.google.com/p/android-palmprint-api , in SVN you can see the source code.




回答3:


I think you need to draw a rectangle that has size as you desire. Then you just need to set that size for preview frame, and when you get the result return from onPreviewFrame , you will process on that data. You can refer the ViewfinderView class of Xzing source here to learn how to draw a rectangle in camera preview. and refer CameraConfigurationManager,PreviewCallback,CameraManager also in xzing source to learn how to set preview size and process result data return from camera driver. Hope this help you.



来源:https://stackoverflow.com/questions/10220549/android-show-rectangle-on-camera

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