Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Scanning outside of yellow borders #229

Closed
kostyabakay opened this issue Aug 18, 2016 · 8 comments
Closed

Scanning outside of yellow borders #229

kostyabakay opened this issue Aug 18, 2016 · 8 comments
Labels

Comments

@kostyabakay
Copy link

I have this trouble on devices with good camera. Is it the bug or some feature? Because I need scanning only in yellow borders.

@kostyabakay
Copy link
Author

I solved my problem by creating class which extends ZBarScannerView and have the same realization, except one line of code:
var14.setCrop(0, height / 3, width, height / 3);
This question was very useful. Please modify your library for this problem.

@OzTK
Copy link
Contributor

OzTK commented Aug 18, 2016

Hi, I wanted to do this too and didn't think it would be that simple to do so I gave up. Does it make the scan results more accurate? Could you post the code of the whole class so that it's easier to visualize where you add that line?
Thanks :)

@kostyabakay
Copy link
Author

kostyabakay commented Aug 18, 2016

Yes, it becomes more accurate. My own class is copy ZBarScannerView except one line of code and this class extends ZBarScannerView. Please find this fragment in class and you will understand. Here is fragment of code with my one line:
Image var14 = new Image(width, height, "Y800");
var14.setData(data);
// setCrop() parameters: left, top, width, height
// http://stackoverflow.com/questions/18918211/how-to-change-area-of-scan-zbar
var14.setCrop(0, height / 3, width, height / 3); // Set scanning for the yellow borders
result = this.mScanner.scanImage(var14);

This setCrop method is very uncomfortable, so I hope the developer of this library will add this feature.

@OzTK
Copy link
Contributor

OzTK commented Aug 23, 2016

Thanks a lot!

@Bigboer
Copy link

Bigboer commented Feb 22, 2017

Has this Library been updated to support this request without having to extend the ZBarScannerView yet?

@GoltsevEugene
Copy link

That helped a lot, imho, it is worth to be included into the lib.
Thanks a lot, @kostyabakay!

@kostyabakay
Copy link
Author

@GoltsevEugene you are welcome :)

@stale
Copy link

stale bot commented May 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label May 12, 2020
@stale stale bot closed this as completed May 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants