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?
1. Scan
2. Target Area
3. Cancel Button

Any insights would be helpful.


  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    There are some sample on GitHub
  • toyinstoyins USMember ✭✭
    edited September 2017

    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!" 
               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">

  • 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 ✭✭✭✭✭


    or this, but I have never tried it

  • RyanWatsonRyanWatson USMember ✭✭✭

    @AlessandroCaliaro said:

    or this, but I have never tried it

    I find it weird that there aren't any current solutions for scanning QR/Barcodes. Everything hasn't been updated in awhile.

  • mattbidasmattbidas Member ✭✭

    Hi Guys !!!

    Hi @toyins , Could you help me, please ?

    I need to create a custom page to Scanner Qr Code, but I did not understand the instructions of Github.

    Could you show me an example for Xamarin.Forms ?

    Thanks in advance!

  • toyinstoyins USMember ✭✭

    Hi @mattbidas, I got the code above working with a Target area using a the RelativeLayout element and an Image that serves as an overlay.

Sign In or Register to comment.