Deskew example for C++ Builder
This example automatically straightens the bitmap and repaints the image. The image to be straightened should be mainly text.
long lAngle;
LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Deskew(LEADRasterView1->Raster, RGB(255, 0, 0), 0);
lAngle= pRasterProc->DeskewAngle;
pRasterProc-> Release ( );
ShowMessage ("Rotation: " + IntToStr((int)lAngle) + "' hundredths of degrees");