'Declaration
Public Function FirstBarcode() As CiBarcode
public CiBarcode FirstBarcode()
public function FirstBarcode(): CiBarcode;
public function FirstBarcode() : CiBarcode;
public: CiBarcode^ FirstBarcode();
'Declaration
Public Function FirstBarcode() As CiBarcode
public CiBarcode FirstBarcode()
public function FirstBarcode(): CiBarcode;
public function FirstBarcode() : CiBarcode;
public: CiBarcode^ FirstBarcode();
Use FirstBarcode/NextBarcode methods when searching for barcodes with specific requirements, e.g., prefix presence in CiBarcode.Text value
void ReadBarcodes2DFirstNext(string imageFile) { // Create objects and open input images CiServer ci = Inlite.ClearImageNet.Server.GetThreadServer(); CiBarcode Barcode; CiPdf417 reader = ci.CreatePdf417(); // To read PDF416 barcodes // CiDataMatrix reader = ci.CreateDataMatrix(); // To read DataMatrix barcodes // CiQR reader = ci.CreateQR(); // To read QR barcodes reader.Image.Open(imageFile, 1); // Configure reader // reader.Directions = FBarcodeDirections.cibHorz; // Limit barcode search direction (Faster processing) Barcode = reader.FirstBarcode(); while (Barcode != null) { Console.WriteLine(Barcode.Text); // if (barcodeFound) break Exit For ' End processing after the first barcode matching specific requirements is found Barcode = reader.NextBarcode(); } }
Sub ReadBarcodes2DFirstNext(imageFile As String) ' Create objects and open input images Dim ci As CiServer = Inlite.ClearImageNet.Server.GetThreadServer() Dim Barcode As CiBarcode, reader As Object reader = ci.CreatePdf417() ' To read PDF416 barcodes ' reader = ci.CreateDataMatrix() ' To read DataMatrix barcodes ' reader = ci.CreateQR() ' To read QR barcodes reader.Image.Open(imageFile, 1) ' Configure reader ' reader.Directions = FBarcodeDirections.cibHorz ' Limit barcode search direction (Faster processing) Barcode = reader.FirstBarcode() Do While Not Barcode Is Nothing Console.WriteLine(Barcode.Text) ' If (barcodeFound) Then Exit For ' End processing after the first barcode matching specific requirements is found Barcode = reader.NextBarcode() Loop End Sub