AnnAutoHilightPen example for Delphi

This Example assumes that you have a menu item named "_miHilightPen". By selecting this menu item and deselecting it, you can notice the effect of changing the AnnAutoHilightPen property value.

procedure TForm1.FormCreate(Sender: TObject);
var
   hObject: HANNOBJECT;
begin
   LEADAnn1.UnlockSupport(L_SUPPORT_DOCUMENT, 'TestKey');

   LEADAnn1.Load('e:\Image1.bmp', 0, 0, 1);
   LEADAnn1.AnnUserMode:= ANNUSERMODE_DESIGN;

   hObject:= LEADAnn1.AnnCreate(ANNOBJECT_RECT, True, True);
   LEADAnn1.AnnRectHeight[hObject]:= 100;
   LEADAnn1.AnnRectWidth[hObject]:= 200;
   LEADAnn1.AnnRectLeft[hObject]:= 50;
   LEADAnn1.AnnRectTop[hObject]:= 50;
   _miHilightPen.Checked:= False;
end;

procedure TForm1._miHilightPenClick(Sender: TObject);
begin
   _miHilightPen.Checked:= Not _miHilightPen.Checked;
   if(_miHilightPen.Checked)then
      LEADAnn1.AnnAutoHilightPen:= RGB($C0, $C0, $C0)
   else
      LEADAnn1.AnnAutoHilightPen:= RGB($FF, $FF, $FF);
end;