CreateMaskFromBitmapRgn example for C++ Builder
void __fastcall TForm1::Button1Click(TObject *Sender)
{
int nRet;
/* This example loads an image, sets a color region using black, */
/* and then creates a 1-bit mask image from that bitmap. */
nRet= LEADImage1->Load ("IMAGE1.CMP", 0, 1, 1);
if(nRet == SUCCESS)
{
LEADImage1->SetRgnColor(RGB(0, 0, 0), L_RGN_SET);
nRet= LEADImage1->CreateMaskFromBitmapRgn ();
if(nRet == SUCCESS)
LEADImage2->Bitmap = LEADImage1->MaskBitmap;
}
}