AnnInsert example for Delphi

Note:

This topic is for Document/Medical only.

//This example
//1.creates an ellipse annotation object
//2.sizes the ellipse
//3.inserts the ellipse into the annotation container
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
   hEllipseObject: longint ;
begin

   RasterAnn.AnnCreate ( ANN_OBJECT_ELLIPSE, False, True);
   hEllipseObject:= RasterAnn.AnnObject;

   RasterAnn.AnnRectLeft [hEllipseObject] := 0;
   RasterAnn.AnnRectTop [hEllipseObject] := 0;
   RasterAnn.AnnRectWidth [hEllipseObject] := 100;
   RasterAnn.AnnRectHeight [hEllipseObject]:= 100;
   RasterAnn.AnnInsert ( RasterAnn.AnnContainer, hEllipseObject, False ) ;
end;