I have used the Zxing.Net.Mobile Nuget package... I have made Auto-rotate=false, so that it can scan vertical barcodes. 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. If activated, the code will be rotated three times and checked from all 90° angles.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.