Warle
Warle

Reputation: 123

Android - barcode scanner - how to scan only in defined area

i've made an Android app with a barcode scenner following this tutorial: https://www.varvet.com/blog/android-qr-code-reader-made-easy/ (https://github.com/varvet/BarcodeReaderSample). It uses gms:play-services-vision and it works well and fast, but it uses a full screen camera to find a barcode/qr code and I would like to set some focus area to search only in some square in the midle of the screen(like the most of qr scanner apps has), so you would be able to select and focus on one barcode when there are more of them on small space.

Is there any way how to tell detector to search for barcode only in some area?

Thanks

Upvotes: 2

Views: 1922

Answers (1)

Warle
Warle

Reputation: 123

Exactly as Michael said, each Barcode has method getBoundingBox() returns the barcode's axis-aligned Rect.

Upvotes: 1

Related Questions