android show rectangle on camera

11,612

Solution 1

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

Solution 2

You can see my open source application http://code.google.com/p/android-palmprint-api , in SVN you can see the source code. The draw a AR information on real time camera image

Solution 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.

Share:
11,612
P basak
Author by

P basak

Updated on June 29, 2022

Comments

  • P basak
    P basak almost 2 years

    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.