(Read-only) Gets a value that indicates whether the specified barcode is duplicated.
public bool IsDuplicated {get;}
Public ReadOnly Property IsDuplicated As Boolean
public:
property bool IsDuplicated {
bool get();
}
true, the barcode is duplicated; false, the barcode is not duplicated.
This property determines whether a barcode is duplicated in another location in the image.
LEADTOOLS provides a number of functions to let you work with duplicated barcodes. They let you:
To determine whether a barcode is duplicated, use the IsDuplicated property. If a barcode is duplicated, the DuplicatedIndex property will return the index of the first barcode in the array after the specified barcode, which is a duplicate of the specified barcode. The DuplicateCount property will get the total number of barcodes duplicated for the current barcode.
If you know the index of a barcode within an array, use the IndexDuplicate property to get the next instance of a duplicated barcode. Call the GetFirstDuplicatedIndex method to find the index of the first barcode in the array that is a duplicate of the barcode at the specified index. Call the GetNextDuplicated method to find the index of the next barcode in the array that is a duplicate of the barcode at the specified index.
To find out how many sets of barcodes are duplicated (for example, in an array of ten barcodes, the first, third, and fifth might be duplicates of each other, while the 4th, 8th and 9th are duplicates of a different barcode), use the following code:
VB
Private Function GetSetsCount(ByRef barcodeData As RasterCollection(Of BarcodeData)) As Integer Dim i As Integer Dim j As Integer Dim count As Integer Dim visited() As Boolean ReDim visited(barcodeData.Count) count = 0 For i = 0 To barcodeData.Count - 1 If visited(i) Then Continue For End If visited(i) = True count += 1 j = i While barcodeData(j).IndexDuplicate <> -1 And barcodeData(j).IndexDuplicate <> 255 j = barcodeData(j).IndexDuplicate visited(j) = True End While Next Return count End Function`
C#
public int GetSetsCount(RasterCollection barcodeData) { int i, j, count; bool [] visited = new bool [barcodeData.Count]; count = 0; for (i = 0; i \< barcodeData.Count; i++) { if (visited[i]) continue; visited[i] = true; count++; j = i; while (barcodeData[j].IndexDuplicate != -1 && barcodeData[j].IndexDuplicate != 255) { j = barcodeData[j].IndexDuplicate; visited[j] = true; } } return count; }`
After this code is executed, count
will contain the number of different sets of barcodes.
![]() |
Products |
Support |
Feedback: IsDuplicated Property - Leadtools.Barcode |
Introduction |
Help Version 19.0.2017.6.21
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.