ClearImage API and Initialization


ClearImage funcationality is packaged as:

  • ClearImageNet.dll – .NET assembly supports AnyCPU, x86 and x64 devlopement. ClearImage installers automatically place ClearImageNet.dll is GAC.
  • ClearImage.dll – Windows DLL supports COM and JNI entry points. DLL is distribute as 32-bit version (ClearImage.dll) and 64-bit version (ClearImage.x64.dll). ClearImage COM is regsitered during instalation process. Alternativley it can be used as registration-free COM.

The following describes essential steps of using ClearImage in various programming environments.

.NET API

.NET is a higher level API implemented in Inlite.ClearImageNet namespace of ClearImageNet.70.
ClearImageNet assembly also contains secondary Inlite.ClearImage namespace that is substantially compatible with COM API. It is designed for easy porting from legacy ClearImage application to .NET. It also support few low level functionality not accsible through Inlite.ClearImageNet namespace. Since it is a legacy API no examples are provided.


C#



Add reference to ClearImageNet.70 assembly.
Use try/catch to detect and report errors.

VB



Add reference to ClearImageNet.70 assembly.
Use try/catch to detect and report errors.

COM API

This is a lower level API to support development in all languages interfacing to COM model. Example show use with C++, PHP, Delphi, VBScript/ASP. In addition legacy VB6 and Java through COM-Java bridge (like EzJCom) would use COM API.


C++



Add this line to each file using ClearImage COM API or to a shared header file.
#import "progid:ClearImage.ClearImage" exclude("LONG_PTR") no_namespace named_guids
NOTE: Building x64 project import ClearImage.x64.dll using explicit path rather then progid.
Use try/catch to detect and report errors.


PHP



Create ClearImage COM Server:
$Ci = new COM("ClearImage.ClearImage");

Delphi



Add ClearImage COM to your project:
  • In Project menu select Import Type Library
  • Select ClearImage COM Server in list box
  • Click on the Create Unit button

For Console (DOS) application:

  • Add to uses ActiveX, Windows
  • Call CoInitialize(nil); before any ClearImage calls
  • Call CoUnInitialize; before exiting application


Use exception handling to detect and report errors.


VBScript/ASP


Create ClearImage COM Server:
Set Ci = CreateObject("ClearImage.ClearImage")

Java API

This API is modeled on COM through JNI interface to ClearImage.Dll. Java examples uses this API.
Java API is availbale only in ClearImage 8. Use ClearImage COM bridge with ClearImage 7.


Java



Add ClearImageJ.jar to CLASSPATH. Make ClearImage DLL using on these methods:
  • Automatically load ClearImage.dll from any Windows PATH location or Java library path specified by “java.library.path”. DLL should be named ClearImage.dll
  • Load DLL using name name and directory with CiServer.loadClearImage() method.

Use 32-bit or 64-bit ClearImage DLL version to match Java Runtime environment. For automatic loading this might require renaming of DLL to ClearImage.dll.

Use try/catch to detect and report errors.