Hi,
Hi
Hi,
Thank you for replying.
I know the way you mentioned.
But I want to know that are there any properties for setting order type on BarCodeReader objects.
When multiple barcodes founded on the file, I will have to order them using all barcode regions.
It will cost extra process and sorting algorithms on my way.
How does the sdk process on the file while finding barcodes ? Which analysis direction (Horizontal or vertical) is used when reader.OrientationHints property is RecognitionHints.Orientation.NoRotate?
yns:How does the sdk process on the file while finding barcodes ? Which analysis direction (Horizontal or vertical) is used when reader.OrientationHints property is RecognitionHints.Orientation.NoRotate?
Hi,
I attached sample image containing multiple barcodes. Could you please analyze?
I want to get barcodes on the file from left to right order while reader.Read() executing. I defined sample order on attached image.
Is there are any property for managing left to right read.
Hi
The issues you have found earlier (filed as BARCODENET-33606) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi
Thanks for your patience. Please try the following source code below:
string path = @“c:\temp\MultipleBarcodes.tif”;
List<FoundBarCodes> found = new List<FoundBarCodes>();
using (BarCodeReader reader = new BarCodeReader(path, BarCodeReadType.Code128))
{
while (reader.Read())
found.Add(new FoundBarCodes(reader.GetCodeText(), reader.GetRegion()));
}
found.Sort(new FoundComparator());
public struct FoundBarCodes
{
private string codetext;
public readonly BarCodeRegion region;
public FoundBarCodes(string text, BarCodeRegion reg)
{
codetext = text;
region = reg;
}
}
public class FoundComparator : IComparer<FoundBarCodes>
{
#region Implementation of IComparer
public int Compare(FoundBarCodes found1, FoundBarCodes found2)
{
Point[] found1Points = found1.region.Points;
Point[] found2Points = found2.region.Points;
Point found1XYMin = new Point(int.MaxValue, int.MaxValue);
Point found2XYMin = new Point(int.MaxValue, int.MaxValue);
foreach (Point p in found1Points)
if (p.X < found1XYMin.X && p.Y < found1XYMin.Y)
{
found1XYMin.X = p.X;
found1XYMin.Y = p.Y;
}
foreach (Point p in found2Points)
if (p.X < found2XYMin.X && p.Y < found2XYMin.Y)
{
found2XYMin.X = p.X;
found2XYMin.Y = p.Y;
}
if (found1XYMin.X < found2XYMin.X && found1XYMin.Y < found2XYMin.Y)
return -1;
if (found1XYMin.X > found2XYMin.X && found1XYMin.Y > found2XYMin.Y)
return 1;
if (found1XYMin.Y < found2XYMin.Y)
return -1;
if (found1XYMin.Y > found2XYMin.Y)
return 1;
return 0;
}
#endregion
}
Please let me know in case of any confusion or questions.