Code Snippet
Collapse
Copy Code
BITMAP bm;
GetObject(background, sizeof(BITMAP), &bm);
AlphaBlend(hdcMemWork, 0,0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0,
bm.bmWidth, bm.bmHeight, blendFkt)
SelectObject(hdcMem, hbmOld);
if(bmInfo.bmiHeader.biBitCount == 32 )
{
for (int y=0; y<bmInfo.bmiHeader.biHeight; ++y)
{
BYTE *pPixel= (BYTE *) lpDIBBits + bmInfo.bmiHeader.biWidth * 4 * y;
for (int x=0; x<bmInfo.bmiHeader.biWidth ; ++x)
{
pPixel[0]= pPixel[0]*pPixel[3]/255;
pPixel[1]= pPixel[1]*pPixel[3]/255;
pPixel[2]= pPixel[2]*pPixel[3]/255;
pPixel+= 4;
}
}
}