SetRgnFromMask example for C++ 5 and later
ILEADRasterIO *pRasterIO = NULL;
ILEADRaster *pRaster;
int nRet;
CoCreateInstance(
CLSID_LEADRaster,
NULL,
CLSCTX_ALL,
IID_ILEADRaster,
(void**)&pRaster
);
CoCreateInstance(
CLSID_LEADRasterIO,
NULL,
CLSCTX_ALL,
IID_ILEADRasterIO,
(void**)&pRasterIO
);
// This example sets a region into a bitmap using a 1-bit black-and-white mask image.
nRet = pRasterIO->Load(m_LEADRasterView1.GetRaster (), "c:\\parrots.jpg", 16, 0, 1);
nRet = pRasterIO->Load(m_LEADRasterView2.GetRaster(), "c:\\Test2.jpg", 16, 0, 1);
m_LEADRasterView1.GetRaster().SetMaskBitmap(m_LEADRasterView2.GetRaster().GetBitmap());
m_LEADRasterView1.GetRaster().SetRgnFromMask(L_RGN_SET);
m_LEADRasterView1.GetRaster().SetMaskBitmap(0);
pRasterIO->Release();
pRaster->Release();