I am trying to develop an application in C# / Windows Form with Vintasoft to read a barcode 128 and know the Dimension (min width of narrow black bar).
For this I use the above code, but I do not find any information of the Dimension value behind the informations collected in the infos value obtained from IBarcodeInfo[] infos = reader.ReadBarcodes(barcodeImage);
Is Vintasoft able to find and display this information (1 px, 2px, 3px etc.) ?
Thank you for your help.
Code used is the following :
Code: Select all
(lbInfos is a ListBox on my form).
public void ReadBarcodesFromImage(Image barcodeImage)
{
lbInfos.Items.Clear();
// create barcode reader
BarcodeReader reader = new BarcodeReader();
// specify that reader must search for Code39, Code39Extended,
// Code128, SSCC18 and DataMatrix barcodes
reader.Settings.ScanBarcodeTypes =
BarcodeType.Code39 |
BarcodeType.Code128 |
BarcodeType.DataMatrix;
reader.Settings.ScanBarcodeSubsets.Add(BarcodeSymbologySubsets.Code39Extended);
reader.Settings.ScanBarcodeSubsets.Add(BarcodeSymbologySubsets.SSCC18);
// specify that reader must search for horizontal and vertical barcodes only
reader.Settings.ScanDirection = ScanDirection.Horizontal | ScanDirection.Vertical;
// use Automatic Recognition
reader.Settings.AutomaticRecognition = true;
// read barcodes from image
IBarcodeInfo[] infos = reader.ReadBarcodes(barcodeImage);
// if barcodes are not detected
if (infos.Length == 0)
{
Console.WriteLine("No barcodes found.");
}
// if barcodes are detected
else
{
// get information about extracted barcodes
Console.WriteLine(string.Format("{0} barcodes found:", infos.Length));
Console.WriteLine();
for (int i = 0; i < infos.Length; i++)
{
IBarcodeInfo info = infos[i];
lbInfos.Items.Add(string.Format("[{0}:{1}]", i + 1, info.BarcodeType));
lbInfos.Items.Add(string.Format("Value: {0}", info.Value));
lbInfos.Items.Add(string.Format("Region: {0}", info.Region));
}
}
}