首页 文章

无法扫描code39条形码 - xamarin表格

提问于
浏览
0

我'm using ZXing.Mobile.Forms to scan the barcodes. I' m试图扫描Code39格式的条形码 . 如果条形码具有较少的值,如1231214,14123,那么它会给我一个结果 . 但它不会扫描值大于32位的条形码 . 我正在附加无法扫描的条形码图像 . barcode image

请帮我解决这个问题 .

这是我从示例中获得的代码:

var scanner = new ZXing.Mobile.MobileBarcodeScanner();
        var option = new ZXing.Mobile.MobileBarcodeScanningOptions { UseCode39ExtendedMode = true, TryHarder = true, PureBarcode = true };
        var result = await scanner.Scan(option);

        if (result != null)
            await Application.Current.MainPage.DisplayAlert("It says..", result.Text, "Cancel");
        await Application.Current.MainPage.Navigation.PopAsync(true);

谢谢,Ajithbabu

1 回答

  • 0

    我刚刚使用 ZXing.Net.Mobile.Forms 版本 2.4.1 对iOS设备进行了快速测试,它可以正常使用您的图像: 1M8GDM9AXKPO42788 . 因此,它不是库问题,而是硬件问题,代码问题或可见性条件 .

    这是适合我的代码:

    async void Handle_Clicked(object sender, System.EventArgs e)
    {
        var scanner = new ZXing.Mobile.MobileBarcodeScanner();
        var result = await scanner.Scan();
    
        if (result != null)
            Console.WriteLine("Scanned Barcode: " + result.Text);
    }
    

相关问题