ftylitak / qzxing

Qt/QML wrapper library for the ZXing library. 1D/2D barcode image processing library
Apache License 2.0
621 stars 340 forks source link

How can i rotate the captureRect of QZXingFilter #204

Closed MichaelSavchenko67 closed 3 years ago

MichaelSavchenko67 commented 3 years ago

https://github.com/ftylitak/qzxing/blob/9973b3dd786298c6389476058639a25020e5507b/examples/QZXingLive/main.qml#L92

ftylitak commented 3 years ago

Hello @MichaelSavchenko67

I am not really sure what you want to do. I would say it is just a matter how you define the Qt.rect(). The constructor of the Qt.rect takes 4 arguments (x, y, width and height ) just adjust it based on your needs.

By default, the source code uses decimal values which are the persentage of width or height.

Was this any helpfull?

DenPonomarchuk commented 3 years ago

How do I rotate the readout image? Now the barcode is read vertically, but how to read it horizontally?

ftylitak commented 3 years ago

Hello @MichaelSavchenko67 and @DenPonomarchuk

a long time ago @Eism proposed a solution to this in issue #120 I have just push a new branch with this solution: https://github.com/ftylitak/qzxing/tree/qzxingfilter-orientation-support

Since I have an issue with my build environment right now, could any of you pull the latest changes from that branch and test it if it working? Otherwise I believe sometime till tomorrow I will manage to test it myself.

DenPonomarchuk commented 3 years ago

It works. The only thing is, it is better to use QTransform instead of QMatrix (recommendation from Qt). QTransform matrix;.

Eism commented 3 years ago

I'm happy that after two years my solution became useful :)

ftylitak commented 3 years ago

Its was my bad all this time, I had forgotten to merge it back then.

I have just pushed the latest changes to that branch. I would really appreciate if you could once again verify that it works as needed. As soon as this happens, it will be merged to the master branch.

Thank you all very much for your contribution and testing!

DenPonomarchuk commented 3 years ago

Horizontal reading is successful! The value of the parameter orientation being set - works! Thanks for the merge to master.