ClearImage COM Server
Getting Started
Send Feedback

To start development of ClearImage project:

The following shows typical elements of a ClearImage-based program.

To start Visual Basic development

See Example VB6 project

  1. From menu: Project ->  References...
    Check 'ClearImage COM Server'

  2. Create CiServer object:
    Dim Ci As ClearImage. CiServer
    Set Ci = New CiServer

  3. Create an CiImage object:
    Dim Image as CiImage
    Set Image=Ci.CreateImage

  4. Open image file:
    Image.Open "MyImageFile.tif", 1

  5. Create some processing object and attach CiImage object to this object:
    Dim Bc as CiBarcodePro
    Set Bc = Ci.CreateBarcodePro
    Bc.Image = Image

  6. Configure processing object properties (if needed):
    Bc.AutoDetect1D = ciTrue

  7. Execute processing object methods (modify image or perform measurements):
    Bc.Find

  8. Process results:
    Dim Barcode as CiBarcode
    For each Barcode in Bc.Barcodes
      '  Do something with Barcode
    Next

  9. Do something else with Image (step 5) or open another image file (step 4).
     

To start C++ development

See  C++ Example  project.   This example use COM Smart Pointers.

  1. Import ClearImage Type Library.  Add to all source files using ClearImage objects:
    #import  "progid:ClearImage.ClearImage" exclude("LONG_PTR") no_namespace  named_guids

  2. Compile Debug version project.  This creates Type Library Header file:  ClearImage.tlh.
    Add it "Header Files" to have ClearImage object visible in ClassView

  3. Open COM
    CoInitialize(NULL);

  4. Declare and create CiServer object
    ICiServerPtr Ci;
    HRESULT hr = Ci.CreateInstance(__uuidof(CiServer));

  5. Declare and create CiImage object
    ICiImagePtr Image = Ci->CreateImage();

  6. Open image file
    Image->Open (_bstr_t("MyImageFile.tif"), 1);

  7. Create some processing object and attach CiImage object to this object:
    Bc =  Ci->CreateBarcodePro ();
    Bc->Image = Image;

  8. Configure processing object properties (if needed):
    Bc->AutoDetect1D = ciTrue;

  9. Execute processing object methods (modify image or perform measurements):
    Bc->Find(0);

  10. Process results:
    for (int i = 1 ; i <= Bc->Barcodes->Count ; i++)
       DisplayBarcode (Bc->Barcodes->Item[i]);

  11. Do something else with Image (step 7) or open another image file (step 6).

Development issues to consider

See additional  programming elements in program examples:

© 1992-2011. Inlite Research, Inc. All Rights Reserved.