meme avec gdi32.lib ( libgid32.a avec devcpp) ca ne fonctionne pas . ..
et windows.h est bien inclus . ..
le code de la fonction qui utilise TransparentBlt:
void Bitmap::Draw(HDC hDC, int x, int y, BOOL bTrans, COLORREF crTransColor)
{
if ( m_hBitmap ! = NULL)
{
/ / Create a memory device context for the bitmap
HDC hMemDC = CreateCompatibleDC(hDC);
/ / Select the bitmap into the device context
HBITMAP hOldBitmap = ( HBITMAP)SelectObject(hMemDC, m_hBitmap);
/ / Draw the bitmap to the destination device context
if(bTrans)
TransparentBlt(hDC, x, y, GetWidth(), GetHeight(), hMemDC, x, y, GetWidth(), GetHeight(), crTransColor);
else
BitBlt(hDC, x, y, GetWidth(), GetHeight(), hMemDC, 0, 0, SRCCOPY);
/ / Restore and delete the memory device context
SelectObject(hMemDC, hOldBitmap);
DeleteDC(hMemDC);
}
}