Transparent example for C++ 5.0 and later
long x,y;
//set the backcolor of the control to BLUE
m_LEADRasterView1.SetBackColor(RGB(0,0,255));
AfxMessageBox(TEXT("Pause"));
//create a 100x100 image
m_LEADRasterView1.GetRaster().CreateBitmap(100.0f, 100.0f, 24);
//fill some of the image with RED, the rest with black
m_LEADRasterView1.SetAutoRepaint(FALSE);
for(y=0; y<100; y++)
{
for(x=0; x<25; x++)
m_LEADRasterView1.GetRaster().SetPixel((float)x, (float)y,
RGB(255,0,0));
for(x=25; x<75; x++)
m_LEADRasterView1.GetRaster().SetPixel((float)x, (float)y,
RGB(0,0,0));
for(x=75; x<100; x++)
m_LEADRasterView1.GetRaster().SetPixel((float)x, (float)y,
RGB(255,0,0));
}
m_LEADRasterView1.SetAutoRepaint(TRUE);
AfxMessageBox(TEXT("Pause"));
//now, set Red as the transparent color
m_LEADRasterView1.GetRaster().SetBitmapTransparentColor(RGB(255,0,0));
m_LEADRasterView1.GetRaster().SetBitmapEnableTransparency(TRUE);
AfxMessageBox(TEXT("Pause"));
//now set the control transparent
m_LEADRasterView1.SetTransparent(TRUE);