Combine example for C++ Builder

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

   float SrcLeft;
   float SrcTop;
   float DstLeft;
   float DstTop;
   float DstWidth;
   float DstHeight;
   float fTrimLeft;
   float fTrimTop;
   float fTrimWidth;
   float fTrimHeight;
   LEADRasterProcess* pRasterProc= NULL;

     CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);

   Cursor= crHourGlass;
   LEADRasterView2->Raster->RefBitmap = False;
   LEADRasterView2->Raster->Bitmap = LEADRasterView1->Raster->Bitmap;
   fTrimLeft= (LEADRasterView2->Raster->BitmapWidth * 0.2);
   fTrimTop = (LEADRasterView2->Raster->BitmapHeight * 0.2);
   fTrimWidth = (LEADRasterView2->Raster->BitmapWidth * 0.6);
   fTrimHeight = (LEADRasterView2->Raster->BitmapHeight * 0.6);
   pRasterProc->Trim (LEADRasterView2->Raster, fTrimLeft, fTrimTop, fTrimWidth, fTrimHeight);
   pRasterProc->SpatialFilter (LEADRasterView2->Raster, FLT_LINESEG_LTOR);
   DstLeft = fTrimLeft;
   DstTop = fTrimTop;
   DstWidth = fTrimWidth;
   DstHeight = fTrimHeight;
   SrcLeft= 0;
   SrcTop = 0;
   pRasterProc->Combine (LEADRasterView1->Raster,DstLeft, DstTop,
                               DstWidth, DstHeight,
                               LEADRasterView2->Raster,
                               SrcLeft, SrcTop, CB_OP_ADD);
   LEADRasterView1->ForceRepaint ();
   pRasterProc-> Release( );
   Cursor= crDefault;