AnnGetVisible example for Delphi
//This example toggles the visible state of 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
bVisible: WordBool ;
begin
RasterAnn.AnnGetVisible (RasterAnn.AnnContainer);
bVisible:= RasterAnn.AnnVisible;
RasterAnn.AnnSetVisible (RasterAnn.AnnContainer, Not bVisible, ANN_FLAG_RECURSE, '');
RasterAnn.AnnGetVisible (RasterAnn.AnnContainer);
bVisible:= RasterAnn.AnnVisible;
if ( bVisible ) then
ShowMessage ('AnnGetVisible: True')
else
ShowMessage ('AnnGetVisible: False');
end;