See the snippet for Alpha Blending with bitmap
void CAlphaBlendingBitmapDlg::DrawBitmap()
{
CDC* pDC = GetDC();
ASSERT(pDC);
if (!pDC)
return;
CBitmap bitmap;
// loading the bitmap
bitmap.LoadBitmap(IDB_BITMAP_SCN);
// get the bitmap size
BITMAP bmp;
bitmap.GetBitmap(&bmp);
// create memory DC
CDC memDc;
memDc.CreateCompatibleDC(pDC);
memDc.SelectObject(&bitmap);
// giving the blend option
BLENDFUNCTION blndFxn = {0};
blndFxn.BlendOp = AC_SRC_OVER;
blndFxn.SourceConstantAlpha = m_nAlpha;
blndFxn.AlphaFormat = AC_SRC_ALPHA;
// drawing into the dialog
pDC->AlphaBlend(50,11,bmp.bmWidth,bmp.bmHeight,
&memDc,0,0,bmp.bmWidth,bmp.bmHeight,blndFxn);
}