AnnAutoHilightPen example for C++ Builder

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.

void __fastcall TForm1::FormCreate(TObject *Sender)
{
   HANNOBJECT hObject;

   LEADAnn1->UnlockSupport(L_SUPPORT_DOCUMENT, "TestKey");

   LEADAnn1->Load("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;
}

void __fastcall TForm1::_miHilightPenClick(TObject *Sender)
{
   _miHilightPen->Checked= ! _miHilightPen->Checked;
   if(_miHilightPen->Checked)
      LEADAnn1->AnnAutoHilightPen= RGB(0xC0, 0xC0, 0xC0);
   else
      LEADAnn1->AnnAutoHilightPen= RGB(0xFF, 0xFF, 0xFF);
}