AnnSetBitmap example for C++ Builder

void TForm1::AnnSetBitmap(HANNOBJECT hStamp, HANNOBJECT hPlgn)
{
   L_INT nRet;
   TColor clTemp;
   bool bTransparent;
   TBitmapHandle StampBitmap;

   clTemp= (TColor)0;
   StampBitmap= 0;
   nRet= LEADAnn2->Load("C:\\flagsel.bmp", 0, 1, 1);
   if(nRet == SUCCESS)
   {
      LEADAnn1->AnnSetBitmap(hStamp, LEADAnn2->Bitmap, false);
      LEADAnn1->AnnSetAutoBackColor(LEADAnn1->AnnAutomation, ANNOBJECT_ALL, (TColor)RGB(40, 80, 160));
      LEADAnn1->AnnGetAutoBackColor(LEADAnn1->AnnAutomation, ANNOBJECT_POLYGON, clTemp);
      ShowMessage("AutoBackColor: " + ColorToString(clTemp));

      LEADAnn1->AnnGetTransparent(hStamp, bTransparent);
      if(!bTransparent)
         LEADAnn1->AnnSetTransparent(hStamp, true, false);

      LEADAnn1->AnnSetTransparentColor(hStamp, clGreen, false);
      LEADAnn1->AnnGetTransparentColor(hStamp, clTemp);
      ShowMessage("TransparentColor: " + ColorToString(clTemp));

      LEADAnn1->AnnSetBackColor(hPlgn, (TColor)RGB(255, 0, 255), false);
      LEADAnn1->AnnGetBackColor(hPlgn, clTemp);
      ShowMessage("BackColor: " + ColorToString(clTemp));

      LEADAnn1->AnnSetForeColor(hPlgn, TColor(RGB(0, 255, 255)), false);
      LEADAnn1->AnnGetForeColor(hPlgn, clTemp);
      ShowMessage("ForeColor: " + ColorToString(clTemp));
      LEADAnn1->AnnGetBitmap(hStamp, StampBitmap);
      LEADAnn1->Bitmap= StampBitmap;
   }
}