Search code examples
androidandroid-cameraandroid-camera-intent

Overlay the Android camera app aka the barcode scanner


When the Android camera opens it fills up the screen in width and height but actually I want the app to open and limit upto certain dimensions on the screen aka BarCode Scanner but here the catch is that the image taken should limit the boundary of the rectangle that the app shows on its surface.

Is this possible?


Solution

  • First: That app is open-source, so feel free to check what they are doing:

    Project on google code

    If i had a guess I'd say they overlay the camera preview with another view (e.g. via addContentView()) and crop the camera-/previewimage after the image callback. So this is definitely possible, you have to crop the image manually though (according to the frame).