How to Scan & Decode Code 128 Barcode in ASP.NET Web Applications
Completely built in managed C# and support both C# & VB.NET library codes
Decode one or several Code 128 barcodes with one line code in ASP.NET projects
Read Code 128 by scanning partial or whole image file in ASP.NET website
Scan Code 128 from gif, tiff, png, jpeg and bmp image files in ASP.NET applications
Able to read other major linear barcode types in ASP.NET web site, like Code 39
Capable of scanning 2D barcodes including QR Code, PDF 417 and Data Matrix
Install ASP.NET Code 128 Barcode Reader DLL
Directly add BarcodeLib.BarcodeReader.dll to your ASP.NET web project reference.
Use Free Visual C# Code to Read Code 128 Barcode
One distinguishing feature of our ASP.NET Code 128 barcode reader dll is its simplicity. Users could accurately read & scan all Code 128 barcodes from common image format files with one-line C# class code:
Use Visual Basic .NET Code to Read Code 128 Barcode Image
It is an easy task to read & decode Code 128 barcode in ASP.NET web applications using VB.NET library code. The VB.NET codes below can help users scan all Code 128 barcodes from the gif image file (code128-aspnet).
Dim datas() AsString = BarcodeReader.read("c:/code128-aspnet.gif", BarcodeReader.CODE128)
Then, all Code 128 barcodes data in sample image "code128-aspnet.gif" will be detected and scanned.
Optimize ASP.NET Web Application Code 128 Barcode Scanning
There exists two ways to improve Code 128 barcode recognition rate in ASP.NET web applications.
Set maxOneBarcodePerPage to true when scanning a maximum Code 128 barcode. In order to read & scan all Code 128 barcodes from an image file, our ASP.NET Code 128 barcode reader will use total 5 algorithms and scan the whole image from 4 directions.
But if there is a large-size Code 128 barcode in the image file, users could set "maxOneBarcodePerPage" to true so the reader will stop reading once it detects one Code 128 barcode. By doing this, you may save your reading time.
Locate and scan the Code 128 barcode region of an image source. If your target Code 128 barcode is located at a certain part of the image file, you could let the reader only scan that region.
You could achieve this by using the concepts of axis. For example, you could ask the reader only scan the top 20% and bottom 20% area by using following C# & VB.NET codes:
OptimizeSetting setting = new OptimizeSetting();
setting.setMaxOneBarcodePerPage(true);
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);
Dim setting As OptimizeSetting = New OptimizeSetting()
setMaxOneBarcodePerPage(True)
Dim top20 As ScanArea = New ScanArea(New Drawing.PointF(0.0F, 0.0F), New Drawing.PointF(100.0F, 20.0F))
Dim bottom20 As ScanArea = New ScanArea(New Drawing.PointF(0.0F, 80.0F), New Drawing.PointF(100.0F, 100.0F))
Dim areas As List(Of ScanArea) = New List(Of ScanArea) areas.Add(top20) areas.Add(bottom20)
setting.setAreas(areas)
Dim datas() AsString = BarcodeReader.read("c:/code128-aspnet.gif", BarcodeReader.CODE128, setting)
The above VB.NET codes are built in Visual Basic 2005
Important notice: The default coordinate of most left top point is (0%, 0%), and the default coordinate of most right bottom point is (100%, 100%). The point X, Y values are expressed in percentage of the whole image.
Other Supported Barcode Types in ASP.NET Barcode Reader SDK
Following 1d & 2d barcode types are all suitable for this Code 128 barcode reader in ASP.NET applications: