CDC::TransparentBlt
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Hi! I am writing a custom control, and I would want to draw two overlapping images using transparency. I have written this code, but it does not work! Does anybody know the correct way of drawing overlapping bitmaps with transparency ? Thank you ! void CMyClass::DCDrawBitmap(HBITMAP hBitmap,LPRECT lpRect) { CDC* pDC = this->GetDC(); CDC dcSrc; dcSrc.CreateCompatibleDC(pDC); dcSrc.DrawState(CPoint(0,0),CSize(m_iCellWidth, m_iCellHeight), hBitmap,DST_BITMAP|DSS_NORMAL); pDC->TransparentBlt(lpRect->left,lpRect->top,m_iCellWidth,m_iCellHeight, &dcSrc,0,0,m_iCellWidth,m_iCellHeight,RGB(255,255,255)); ReleaseDC(&dcSrc); ReleaseDC(pDC); } www.eugigames.tk