Combine example for C++ 5.0 and later

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

ILEADRasterProcess *pRasterProc=NULL;
BeginWaitCursor();
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
                 IID_ILEADRasterProcess, (void**)&pRasterProc);
m_LEADRasterView2.GetRaster ().SetBitmap(m_LEADRasterView1.GetRaster().GetBitmap());
float TrimLeft = (m_LEADRasterView2.GetRaster().GetBitmapWidth() * 0.2f);
float TrimTop = (m_LEADRasterView2.GetRaster().GetBitmapHeight() * 0.2f);
float TrimWidth = (m_LEADRasterView2.GetRaster().GetBitmapWidth() * 0.6f);
float TrimHeight = (m_LEADRasterView2.GetRaster().GetBitmapHeight() * 0.6f);
pRasterProc->Trim(m_LEADRasterView2.GetRaster(),
                  TrimLeft, TrimTop, TrimWidth, TrimHeight);
pRasterProc->SpatialFilter(m_LEADRasterView2.GetRaster(),
                           FLT_LINESEG_LTOR);
float DstLeft = TrimLeft;
float DstTop = TrimTop;
float DstWidth = TrimWidth;
float DstHeight = TrimHeight;
float SrcLeft = 0.0f;
float SrcTop = 0.0f;
pRasterProc->Combine(m_LEADRasterView1.GetRaster(),
                     DstLeft, DstTop, DstWidth, DstHeight,
                     m_LEADRasterView2.GetRaster(),
                     SrcLeft, SrcTop, CB_OP_ADD);
m_LEADRasterView1.ForceRepaint();
pRasterProc->Release();
EndWaitCursor();