LineRemove example for Delphi
var
RasterProc: LEADRasterProcess;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterProc:= CreateComObject (CLASS_LEADRasterProcess) as LEADRasterProcess;
LEADEventSink1.Connect (RasterProc, _LEADRasterProcessEvents);
LEADRasterView1.Raster.UnlockSupport (L_SUPPORT_DOCUMENT, 'TestKey');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
//Line Remove
//This examples removes vertical lines that are at least 200 pixels in length
//and no more than 5 pixels in width
//The lines can have gaps up to two pixels in length
//The LineRemove Event is used to display information about each line removed
RasterProc.EnableDocCleanEvents:= True;
RasterProc.LineRemove (LEADRasterView1.Raster, LINE_USE_GAP, 200, 5, 7, 10, 2, 0, LINEREMOVE_HORIZONTAL);
end;
procedure TForm1. LEADEventSink1Invoke(Sender: TObject; DispID: Integer;
const IID: TGUID; LocaleID: Integer; Flags: Word; Params: tagDISPPARAMS;
varResult, ExcepInfo, ArgErr: Pointer);
var
fStartRow: Single;
fStartCol: Single;
fLength: Single;
begin
case (DispID) of
LEADRASTERPROCESSEVENTS_LINEREMOVE:
begin
fStartRow:= OleVariant(Params.rgvarg^[3]);
fStartCol:= OleVariant(Params.rgvarg^[2]);
fLength:= OleVariant(Params.rgvarg^[1]);
OutputDebugString(pChar('Line at [R,C]' + FloatToStr(fStartRow) + ',' + FloatToStr(fStartCol) + ' Length=' + FloatToStr(fLength)));
end;
end;
end;