Despeckle example for C++ Builder
This example automatically removes specks from the bitmap and repaints the image. Use this on a 1-bit bitmap such as a scanned document.
LEADRasterProcess* pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Despeckle (LEADRasterView1->Raster);
LEADRasterView1->ForceRepaint ();
pRasterProc->Release ( );