Image zones and other features…

In these examples 1D barcodes (Code39 and Code128) are read. To see how to read 2D and postal barcode click here.

Zone reading and other optional parameters

ClearImage Barcode readers are designed to simplify application development. Thus only the general barcode symbology needs to be specified. A few optional parameters add flexibility to the barcode reading:

  • If the expected 1D barcode type is not known in advance set reader.Auto1D=true (.NET) or reader.AutoDetect1D=ciTrue (COM) to detect all the most popular barcode types. If the type is known, then do not use this technique because it slows down the recognition process.
  • The readers search for barcodes in any orientation (360 degree rotation). If the orientation of the barcode is known in advance, then limit the choice of directions to improve recognition speed. To limit the direction of search do:
    • .NET API: Set reader.Horizonal, reader.Vertical, or reader.Diagonal properties to FALSE. At least one property must remain TRUE.
    • COM API: Set reader.Directions only to the desired subset of cibHorz, cibVert, cibDiag
  • Barcodes are searched on the whole page. To limit the search to a specific area:
    • .NET API: Set reader.Zone to desired rectangle.
    • COM API: Assign image zone to reader.Image property.

    NOTE: When defining the zone you should take into account the possibility that the document was scanned upside-down, so you really need to set two mirror image zones.

The following examples demonstrate use of the above parameters.

C#


VB


C++


Java


PHP


Delphi


VBScript/ASP


Read one barcode at a time

The examples on this site retrieve all the found barcodes from an image page or an image file.
In some applications it may be advantageous to retrieve one barcode at a time and to terminate the search once the desired barcode is identified. The following examples demonstrate how to read one barcode a time.

  • .NET API: Assign handler for reader.BarcodeFoundEvent. Then set e.cancel = true in handler when desired barcode is found
  • COM API: Use reader.FirstBarcode then reader.NextBarcode to iterate through barcodes
NOTE: If multiple barcodes are present on the image, the order in which they will be found by the engine is totally unpredictable. You should validate each found barcode against your business logic..

C#


VB


C++


Java


PHP


Delphi


VBScript/ASP