Combine example for C++ Builder

This example copies the Lead1 bitmap to LeadTmp, trims and filters the copied image, and combines the filtered image with the original Lead1 bitmap. Trimming LeadTmp lets you see the difference between filtered and nonfiltered regions.

{
   int TrimLeft, TrimTop, 
       TrimWidth, TrimHeight, 
       DstLeft, DstTop, 
       DstWidth, DstHeight, 
       SrcLeft, SrcTop;
   TLeadImage *LeadTmp;

   Screen->Cursor = crHourGlass;
   LeadTmp = new TLeadImage(this);
   LeadTmp->Visible = false;
   LeadTmp->Parent = this;
   LeadTmp->Bitmap= Lead1->Bitmap;
   TrimLeft = (LeadTmp->BitmapWidth * 2)/10;
   TrimTop = (LeadTmp->BitmapHeight * 2)/10;
   TrimWidth = (LeadTmp->BitmapWidth * 6)/10;
   TrimHeight = (LeadTmp->BitmapHeight * 6)/10;
   LeadTmp->Trim(TrimLeft, TrimTop, TrimWidth, TrimHeight);
   LeadTmp->SpatialFilter(FLT_LINESEG_LTOR);
   DstLeft = TrimLeft;
   DstTop = TrimTop;
   DstWidth = TrimWidth;
   DstHeight = TrimHeight;
   SrcLeft = 0;
   SrcTop = 0;
   Lead1->Combine(DstLeft, DstTop, DstWidth, DstHeight, LeadTmp >Bitmap, SrcLeft, SrcTop, CB_OP_ADD);
   delete LeadTmp;
   Lead1->ForceRepaint();
   Screen->Cursor = crDefault;
}