Despeckle example for Delphi
This example automatically removes specks from the bitmap and repaints the image. Use this on a 1-bit bitmap such as a scanned document.
var
sRet: Smallint;
RasterProc: LEADRasterProcess;
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess ) as LEADRasterProcess;
RasterProc.Despeckle (LEADRasterView1.Raster);
LEADRasterView1.ForceRepaint (sRet);
end;