Hi,
handling IEVision with C++ is a bit twisted because you have to handle return values manually.
First you have to link ievision unit with (among other "pragmas"):
#pragma link "ievision"
Next here is a sample to perform OCR on a image (assume you have a TImageEnView and a TMemo object on the form):
// check if "ievision.dll" is available
if (!IEVisionAvailable()) {
ShowMessage("ievision.dll not loaded!");
exit;
}
// open image
ImageEnView1->IO->LoadFromFile(ImageEnView1->IO->ExecuteOpenDialog());
// embed ImageEnView1 image into a "image" object. This step will be simplified in next version of ImageEn
ImageEnView1->Proc->ConvertTo24Bit();
ImageEnView1->IEBitmap->Origin = ieboTOPLEFT;
_di_TIEVisionImage image;
IEVisionLib->createImage(
ImageEnView1->IEBitmap->Width,
ImageEnView1->IEBitmap->Height,
ievUINT8, 3,
ImageEnView1->IEBitmap->Rowlen,
ImageEnView1->IEBitmap->ScanLine[0],
false, image);
// perform OCR and put results in "str"
_di_TIEVisionOCR OCR;
IEVisionLib->createOCR(":ENG", false, OCR);
_di_TIEVisionWString str;
OCR->recognize(image, IEVisionRect(0, 0, 0, 0), false, str);
// extract unicode string from "str" and put it into Memo1
wchar_t *cstr;
str->c_str(false, cstr);
Memo1->Lines->Text = WideString(cstr);
A complete C++ example will be added in next ImageEn version.