CombineExt example for C++ 5.0 and later
//This example copies the RasterView1 bitmap to RasterView2, trims and filters the copied image, and combines the filtered image with the original Lead1 bitmap image. Trimming RasterView2 lets you see the difference between filtered and nonfiltered regions.
ILEADRasterProcess *pRasterProc=NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&pRasterProc);
float TrimLeft, TrimTop, TrimWidth, TrimHeight;
float DstLeft, DstTop, DstWidth, DstHeight;
float SrcLeft, SrcTop;
m_RasterView2.GetRaster ().SetBitmap (m_RasterView1.GetRaster().GetBitmap ());
TrimLeft = (m_RasterView2.GetRaster().GetBitmapWidth () * 0.2);
TrimTop = (m_RasterView2.GetRaster().GetBitmapHeight () * 0.2);
TrimWidth = (m_RasterView2.GetRaster().GetBitmapWidth () * 0.6);
TrimHeight = (m_RasterView2.GetRaster().GetBitmapHeight () * 0.6);
pRasterProc->Trim(m_RasterView2.GetRaster(), TrimLeft, TrimTop, TrimWidth, TrimHeight);
pRasterProc->SpatialFilter(m_RasterView2.GetRaster(), FLT_LINESEG_HORZ);
DstLeft = TrimLeft;
DstTop = TrimTop;
DstWidth = TrimWidth;
DstHeight = TrimHeight;
SrcLeft = 0;
SrcTop = 0;
pRasterProc->CombineExt(m_RasterView1.GetRaster(), DstLeft, DstTop, DstWidth, DstHeight, m_RasterView2.GetRaster(), SrcLeft, SrcTop, CB_OP_ADD);
m_RasterView1.ForceRepaint ();
pRasterProc->Release();