Scanning using ZXing.Net.Mobile.Forms ZXingScannerView

toyinstoyins USMember ✭✭

How do I use the ZXingScannerView in a content page to Scan a QR Code? I also want to have a red rectangle (Target Area) inside of the view with a cancel button to end the scanning. How do I accomplish this using ZXingScannerView?
Ask?
1. Scan
2. Target Area
3. Cancel Button

Any insights would be helpful.

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    There are some sample on GitHub


    https://github.com/Redth/ZXing.Net.Mobile
  • toyinstoyins USMember ✭✭
    edited September 14

    Thanks Alessandro, I got the ZXingScannerView displaying and scanning, however, I wasn't able to display the Flash button or Target Area ( A Red Square image) on the camera. On the Result event the DisplayAlert Method is throwing an exception.

    <StackLayout Padding="20">
        <Label Text="Welcome to Xamarin Forms!" 
               VerticalOptions="Center" 
               HorizontalOptions="Center" />
    
        <Button Text="Scan" Clicked="Button_OnClicked"></Button>
    
        <Button Text="Scan2" Clicked="Button2_OnClicked"></Button>
    
        <forms:ZXingScannerView x:Name="ZXingScannerView1" IsScanning="True"                     OnScanResult="ZXingScannerView1_OnScanResult" 
         HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
         AutomationId = "zxingScannerView"
         IsAnalyzing="True" IsTorchOn="True" IsVisible="True">
            <forms:ZXingDefaultOverlay ShowFlashButton="True" BottomText="Scanning will happen automatically"                          TopText="Hold your phone up to the barcode" 
                       FlashButtonClicked="ZXingDefaultOverlay_OnFlashButtonClicked"                                            AutomationId="zxingDefaultOverlay" IsVisible="True">
    
            </forms:ZXingDefaultOverlay>
        </forms:ZXingScannerView>
    </StackLayout>
    

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    Realy I don't know. I don't use this library very often... I suggest to open an issue on github

  • toyinstoyins USMember ✭✭

    Thanks Alessandro, for your prompt response.

  • seanydaseanyda GBMember ✭✭✭✭✭

    This project is dead, So adding an issue to GitHub won't make a difference. However, Downgrade to version 2.1.47 which is the most stable release, Many issues for iOS and Android on the newer releases.

    The Torch enable/disable property doesn't work so to hide it you'll need to make a custom overlay. If you want t keep it, stick with the default.

  • JassimRahmaJassimRahma USMember ✭✭✭

    @AlessandroCaliaro said:
    Realy I don't know. I don't use this library very often... I suggest to open an issue on github

    @AlessandroCaliaro so which QR bar code scanner you would recommend to use with Xamarin Forms PCL?

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    zxing

    or this, but I have never tried it

    https://github.com/rebuy-de/rb-forms-barcode

Sign In or Register to comment.