TransparentBlt函数用法
m_bmpPaint.LoadBitmap(IDB_XXX); //第一步将资源的bitmap载入
//第二步在onpaint里面进行描画
CPaintDC pdc(this);
CDC dc;
CBitmap memBitmap;
dc.CreateCompatibleDC(NULL);
CRect rectClient;
GetClientRect(&rectClient);
memBitmap.CreateCompatibleBitmap(&pdc,rectClient.Width(), rectClient.Height());
CBitmap *pOldBit=dc.SelectObject(&memBitmap);
BITMAP bm;
m_bmpPaint.GetBitmap(&bm);
dc.SelectObject(&m_bmpPaint);
::TransparentBlt(pdc.m_hDC,475,175,bm.bmWidth,bm.bmHeight,dc.m_hDC,0,0,bm.bmWidth,bm.bmHeight,RGB(255,255,255));
注:RGB(255,255,255)为图片的背景色