densen2014 / ZXingBlazor

Using ZXing Scan barcode/QR code in blazor
Apache License 2.0
93 stars 39 forks source link

Feature Request: Don't stop scanning after reading a QR code #17

Closed jamieyello closed 1 year ago

jamieyello commented 2 years ago

In my application I need to scan multiple QR codes, so it would be good to have it just scan continuously and trigger the EventCallback many times if needed.

I have found a workaround, which is to immediately reset the form on reading a QR code, it does "work", but it's not really usable since it flickers. htttrhytrhtrjjj

I have taken a look at the source code and unfortunately do not know enough about zxing to fork it and implement it myself, though if someone pointed me in the right direction I might be able to.

densen2014 commented 1 year ago

try

<BarcodeReader ScanResult='((e) => { BarCode=BarCode + "," + e; })'
               ShowScanBarcode="ShowScanBarcode"
               Close="(()=>ShowScanBarcode=!ShowScanBarcode)"
               ScanBtnTitle="Scan"
               ResetBtnTitle="Reset"
               CloseBtnTitle="Close"
               AutoStop="false"
               SelectDeviceBtnTitle="Select Device" />

ShowScanBarcode is a switch for show UI

ScanResult='((e) => { BarCode=BarCode + "," + e; ShowScanBarcode = !ShowScanBarcode; })'

densen2014 commented 1 year ago

v0.2.5

Decodeonce="false"

    <BarcodeReader ScanResult="ScanResult"
                   ShowScanBarcode="ShowScanBarcode"
                   Close="(()=>ShowScanBarcode=!ShowScanBarcode)"
                   ScanBtnTitle="Scan"
                   ResetBtnTitle="Reset"
                   CloseBtnTitle="Close"
                   Decodeonce="false"
                   SelectDeviceBtnTitle="Select Device" />

image

jamieyello commented 1 year ago

Cool 😎