These two free C# sample codes will respectively recognize and output all Code 39 and QR Code barcodes in image files "code39-barcode.gif" & "qrcode-barcode.gif".
How to Read Maximum Barcode Image Using C#.NET Barcode Scanner?
If you need to read a large size image, like 4mb per image, you can adjust our C# Barcode Scanner for .NET to imporve barcode recognition speed.
If there is a maximum one barcode per image, page in tiff or pdf document, please set maxOneBarcodePerPage to true.
If maxOneBarcodePerPage is true, our C#.NET Barcode Scanner DLL will immediately stop reading the barcode once detects one barcode.
If maxOneBarcodePerPage is false (default value), our C#.NET Barcode Scanner Library will use total 5 algorithms and each will read the whole image from 4 directions.
How to Read the Partial Barcode Image Using C#.NET Barcode Reader?
Besides the above two reading methods, you can still recognize the partial image instead of the whole file.
If the barcode is always located one specified area in the image, you can set and let the library scan that area only. And it will reduce lots of scanning time, CPU and memory usage.
You just only need to specify the left top point and right bottom point of the area (the point X, Y values are expressed in percentage of the whole image, so image most left top point is (0%, 0%), and most right bottom point is (100%, 100%)).
The following Free C# code explains how to recognize top 20% and bottom 20% of a Code 39 barcode image.
OptimizeSetting setting = new OptimizeSetting();
ScanArea top20 = new ScanArea(new PointF(0.0F, 0.0F), new PointF(100.0F, 20.0F));
ScanArea bottom20 = new ScanArea(new PointF(0.0F, 80.0F), new PointF(100.0F, 100.0F));
List<ScanArea> areas = new List<ScanArea>(); areas.Add(top20); areas.Add(bottom20);