How to load a Bitmap image
BarcodeScanner ibscanner = new BarcodeScanner();
ibscanner.ReadFromBitmap(new Bitmap('image that will be scanned'));
BarcodeScanner ibscanner = new BarcodeScanner();
ibscanner.ReadFromUrl("http://siteurl/file.jpg");
BarcodeScanner ibscanner = new BarcodeScanner();
ibscanner.ReadFromFile("c:\filepath\file.jpg");
BarcodeScanner ibscanner = new BarcodeScanner();
ibscanner.ReadFromStream(new MemoryStream(imageBytes));
How to get the result
BarcodeScanner ibscanner = new BarcodeScanner();
ibscanner.EnableMultiThreading = False;
ibscanner.ReadFromFile("c:\filepath\file.jpg");
foreach (BarcodeItem barcode in ibscanner.BarcodesList.Values)
{
// Get barcode value
string codeValue = barcode.Barcode;
// Get barcode type
string codeType = barcode.CodeType.ToString();
// Get how many times scanner found this code in the scanned image
string count = barcode.RepeatCounter;
}
MultiThread
BarcodeScanner ibscanner = new BarcodeScanner();
void Init()
{
ibscanner.OnScanningCompleted +=
new BarcodeScanner.ScanningCompletedEventHandler(ibscanner_OnScanningCompleted);
ibscanner.ReadFromFile("c:\filepath\file.jpg");
}
void ibscanner_OnScanningCompleted()
{
foreach (BarcodeItem barcode in ibscanner.BarcodesList.Values)
{
// Get barcode value
string codeValue = barcode.Barcode;
// Get barcode type
string codeType = barcode.CodeType.ToString();
// Get how many times scanner found this code in the scanned image
string count = barcode.RepeatCounter;
}
}
How to enable for scanning only a certain barcode type
BarcodeScanner ibscanner = new BarcodeScanner();
// Disable all barcode types
ibscanner.DisableAllCodeTypes();
// Enable only Code128
ibscanner.Code128.IsEnabled = true;