ASP.NET Barcode SDK Component

ReadBarcodeImage 

 

Read the Barcode for specific zone and return the total count of Barcode.
 

int ReadBarcodeImage(
 Bitmap bitmap,
 int x,
 int y,
 int width,
 int height
)

 

Parameter
bitmap
the GDI+ Bitmap object.

x
Specifies the logical left-coordinate of the starting point of the zone.

y
Specifies the logical top-coordinate of the starting point of the zone.

width
Specifies the width of the zone.

height
Specifies the height of the zone.


Return Value
Return the number of Barcode detected

If your image contain one Barcode and the Barcode have not any rotation, you may set the following properties, it will scan faster.

reader.ScanWithoutRotation = true;
reader.ScanWith45DegreeClockwiseRotation = false;
reader.ScanWith45DegreeCounterClockwiseRotation = false;
reader.ScanWith90DegreeRotation = false;
reader.TryHard = true;
reader.ScanMultiple = false;

Example

   

C# Syntax
using System.Drawing;
using System.Drawing.Imaging;
using BarcodeWrapper;

BarcodeReader reader= new BarcodeReader();
reader.ScanWithoutRotation = true;
reader.TryHard = true;
reader.ScanMultiple = true;
int iMyWidth=0;
int iMyHeight=0;
Bitmap bitmap;

int iPageCount=reader.GetPDFPageCount(strinputpath1);
bool bResult=reader.GetPDFPage(strinputpath1, iPageNo, out iMyWidth, out iMyHeight);
int iScaledWidth = (int)(iMyWidth * 2.5);
int iScaledHeight = (int)(iMyHeight * 2.5);

bitmap = new Bitmap(iScaledWidth, iScaledHeight);
bool bresult =reader.GetPDFBitmap(strinputpath1, iPageNo, bitmap);
int count = reader.ReadBarcodeImage(bitmap, x, y, width, height);
string text = "" + count + " codes found<br><br>";

for (int i = 0; i < count; i++)
{
text += reader.GetBarcodeType(i) + " value:" + reader.GetBarcodeValue(i) + "<br>";
}