Use Visual Studio C++ ClearImage example project or follow the instruction below.
When using the example project, copy ClearImage.dll in the executable folder or in the PATH.
In your Visual Studio C++ project:
Include a copy of C:\Program Files (x86)\Inlite\ClearImageSDK\ClearImage.wrapper.hpp in every source file that uses ClearImage API.
Add a copy of C:\Program Files (x86)\Inlite\ClearImageSDK\ClearImage.lib to your project's Properties->Linker->Input->Additional Dependencies entry.
Place ClearImage.dll in a location where it can be found according to Microsoft's DLL search order rules. Typically it is a working folder where your application started from.
The ClearImage.dll is installed in:
32-bit version from C:\Program Files (x86)\Inlite\ClearImageSDK\win32\ClearImage.dll
64-bit version from C:\Program Files (x86)\Inlite\ClearImageSDK\x64\ClearImage.dll
This code demonstrates the use of ClearImage DLL API. Runtime errors are reported in ExceptionCI object.
While developing your application, you can combine code examples on this page with methods described in ClearImage API documentation. DLL API, as exposed through ClearImage.wrapper.hpp, is substantially similar to COM API and .NET APIInlite.ClearImage namespace.
Exception handling
ClearImage DLL API reports errors as an ExceptionCI object.
This example reads code 39 and code 128 barcodes. Set barcode types used in your application. Setting reader->AutoDetect1D=true; automatically finds the barcode type, but it is slower and is not recommended for production.
This example reads Postal Barcodes from an image file page.
C++
void ReadBarcodePostal_page(const CiServer& Server, const std::wstring& fileName, const long page){try{
CiBarcodePro reader = Server->CreateBarcodePro();
reader->Type = cibf4State;
reader->Image->Open(fileName, page);
reader->Find(0);for(int i =1; i <= reader->Barcodes->Count; i++){
std::wstring type = L"";
switch (reader->Barcodes->Item[i-1]->Type){
case cibUspsIntelligentMail: type = L"US Intelligent Mail ";break;
case cibBpoPostcode: type = L"UK Royal Mail ";break;
case cibAustralianPost: type = L"Australian Mail ";break;
case cibSingaporePost: type = L"Singapore Mail ";break;}
std::wcout << L"Type: "<< type << L" "<< reader->Barcodes->Item[i-1]->Text << std::endl;}}catch(ExceptionCI ex){
std::wcout << L"ERROR: "<< ex.getMessage()<< std::endl;}}
Read Driver's License barcode
This example reads the Driver's License barcode from an image file page.
This example uses some of the most popular image-processing functions. In a production application, the specific sequence of functions should be selected based on specific application needs.