AlphaBlend() will do want you want, however it does not support any scaling. What you need to do is make a mask of each of your bitmaps. You then blit them like this:
Code:
...
if (pImage)
{
CBitmap *pPrevMem=(CBitmap *)pTempDC->SelectObject(pMask);
//Perform transparent stretch blit
m_pMemoryDC->StretchBlt( iX, iY, iTileW, iTileH, pTempDC,
0, 0, iOTileW,iOTileH,SRCAND);
pTempDC->SelectObject(pPrevMem);
pPrevMem=(CBitmap *)pTempDC->SelectObject(pImage);
// Note the use of SRCPAINT rather than SRCCOPY.
m_pMemoryDC->StretchBlt(iX, iY, iTileW, iTileH, pTempDC,
0, 0,iOTileW,iOTileH,SRCPAINT);
pTempDC->SelectObject(pPrevMem);
}
...
There is a lot of information on the internet concerning this. My PrepareMask() function inside of CTileGDI is nearly straight from CodeGuru's forum example.
This means you will be blitting two images per bitmap, but it really is the only way to do this if you want scaling support. There is no way to get a pointer to the buffer in GDI so you cannot manually plot pixels without going through the DC's function. This evaluates to 1 function call per pixel and is much slower than just using this method.
There are a lot of things left unexplained in that code and I cannot possibly explain my entire GDI tile rendering system to you in one post.
Remember that each DC must have a bitmap or it will not work.