简体   繁体   English

ZXing.net.mobile横向扫描

[英]ZXing.net.mobile scan in landscape orientation

I have used the Zxing.Net.Mobile Nuget package... I have made Auto-rotate=false, so that it can scan vertical barcodes. 我使用了Zxing.Net.Mobile Nuget包...我将Auto-rotate = false设置为可以扫描垂直条形码。 The problem is because it starts scanning in portrait theres no way no scan in landscape and also have orientation locked. 问题是因为它开始以纵向扫描,所以没有横向扫描,而且方向锁定。 I want an option to scan locked in landscape. 我想要一个扫描锁定在横向的选项。 Here is my code: 这是我的代码:

               Button scanbutton = FindViewById<Button>(Resource.Id.ScanButton);
        scanbutton.Click += async (sender, e) =>
        {                
                var result = await _scanner.Scan(new MobileBarcodeScanningOptions
                {
                    AutoRotate = false,                   
                });
                if (result != null)
                {                   
                    await CallService();
                }
        };

Check if TryHarder = true inside MobileBarcodeScanningOptions works for you. 检查TryHarder = true MobileBarcodeScanningOptions适合您。 If activated, the code will be rotated three times and checked from all 90° angles. 如果激活,密码将旋转三遍并从所有90°角度进行检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM