P basak
P basak

Reputation: 5004

android show rectangle on camera

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.

Upvotes: 3

Views: 11908

Answers (3)

P basak
P basak

Reputation: 5004

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

Upvotes: 7

Zhou Chang
Zhou Chang

Reputation: 1339

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

Upvotes: 3

MichaelP
MichaelP

Reputation: 2781

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.

Upvotes: 1

Related Questions