Scan, read multiple barcodes from an image file using C#?
One of the most common feature is to scan and find all barcodes with target barcode format from an image file using C#.
string[] datas = BarcodeScanner.Scan("qrcode-barcode.png", BarcodeType.QRCode); BarcodeDetail[] datasInDetail = BarcodeScanner.ScanInDetails( "qrcode-barcode.png", BarcodeType.QRCode);
How to read barcodes with multiple formats from a single image using C#?
Sometimes one image may contain multiple barcodes with different barcode foramts. You can also quickly scan and read all barcodes with specified formats using C# barcode reader library.
- The C# code below will scan the barcode image and find out all barcodes with barcode type QRCode and barcode type Code128
BarcodeDetail[] datas = BarcodeScanner.ScanInDetails("multiple-barcodes.png", new List<BarcodeType> { BarcodeType.QRCode, BarcodeType.Code128 });
How to read barcodes with all supported types from an image using C#?
You can also use one method to read all barcodes with library supported barcode types from a image in C# code. However it will reduce the reading speed,
and may cause the error with wrong recognized barcode data.
- Use property BarcodeType.All to scan and decode all supported barcode formats from an image
BarcodeDetail[] datasInDetail = BarcodeScanner.ScanInDetails( "multiple-barcodes.png", BarcodeType.All);
Common Asked Questions
How to setup an ASP.NET project to read multiple barcodes from a single image in C#?
Creating an ASP.NET web app with multiple barcodes scanning feature is an easy and straightforward task using C# Barcode Reader library.
First build a new ASP.NET web project using Visual Studio, add barcode reader dll or nuget package to the project reference. Now you can
start to scan and read multiple barcodes from a single image file using method
BarcodeScanner.ScanInDetails() in C#.
How to scan and detect multiple barcodes from a single PNG image file using C#?
Using OnBarcode C# Barcode Scanner API, you can read multi-barcode from a single PNG image file through method
Besides PNG image format, you can also scan and recognize multiple barcodes from bitmap, gif, jpeg raster image formats, and multi-page tiff and PDF files in C#.
BarcodeScanner.ScanInDetails(), pass the PNG image file path, and specified mutliple barcode formats in BarcodeType as the parameters using C#.
Besides PNG image format, you can also scan and recognize multiple barcodes from bitmap, gif, jpeg raster image formats, and multi-page tiff and PDF files in C#.
How to quickly scan all barcodes with different barcode types in a bitmap image?
To quickly scan and read all barcodes with different barcode formats from a bitmap image in C#, we recommend you to
provide the all target barcode formats in the method
ScanInDetails. Do not provide the parameter
BarcodeType.All. Using BarcodeType.All, the barcode library will try to scan and match all supported barcode types,
it will consume more scanning and reading time.
How to read each scanned barcode information after detecting multiple barcodes?
After scanning and verifying multiple barcodes using barcode library, the detailed barcode results are stored in
BarcodeDetail array objects in C#.
You can quickly use a for loop to explore and access each individual scanned and verified barcode information, including barcode value, barcode type,
barcode position in the image, and other useful information.
Using method ScanSingleBarcode(), will I get multiple barcodes from the image in C#?
No. Method ScanSingleBarcode will return no more than 1 barcode from the scanned image file in C#. If you want to read all barcodes from a single image file,
you need use method
Scan or ScanInDetails. However using ScanSingleBarcode method will improve the
barcode reading speed.
Does multiple barcode scanning affect barcode reading performance?
If there is no more than one barcode in the image, you'd better use the method
ScanSingleBarcode to reduce the barcode reading time.
The barcode reader library will stop scanning the remaining image area after detecting and verifying the scanned barcode.
It will improve the single barcode reading speed.
Is scanning multiple barcodes suitable for all supported barcode formats?
Yes. You can use BarcodeType.All to scan and read all barcode library supported barcode formats in C#. However if the barcode image quality is poor,
certain barcode formats will get wrong results. We recommend to list all target barcode formats to scan a low quality barcode image file using barcode reader
components.
How to scan barcodes which I do not know the barcode types?
You can provide the parameter
BarcodeType.All to multiple barcodes scanning method. It will scan and detect all barcode library supported barcode
formats in C# projects.
How to improve mutiple barcodes scanning performance in C#?
OnBarcode C# Barcode Reader library includes multiple methods and scanning configurations to improve the barcode
reading performance during multiple barcodes recognition in C# project.
You can configure and apply multi-barcode scanning directions, scanning step intervals, specified scanning image regions, support rotated barcode reading, multi-thread and async barcode scanning to enhance the barcode reading performance. You can also apply the image filter options to improve the barcode detection ratio in C# application.
You can configure and apply multi-barcode scanning directions, scanning step intervals, specified scanning image regions, support rotated barcode reading, multi-thread and async barcode scanning to enhance the barcode reading performance. You can also apply the image filter options to improve the barcode detection ratio in C# application.