AnnMove example for Delphi
Note: |
This topic is for Document/Medical only. |
//This example moves one or more selected annotation objects.
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
DeltaX: Integer;
DeltaY: Integer;
begin
//Use pixels
LEADRasterView1.ScaleMode:= 3;
//Specify arbitrary delta values.
DeltaX:= 20;
DeltaY:= -20;
//Move the selected annotations.
RasterAnn.AnnMove (DeltaX, DeltaY, True);
end;