BitBlt trouble.
Question posted by: DumRat
(Member)
on
June 4th, 2008 02:17 PM
Hi,
Can anyone plz help?
I have the following code for the WM_PAINT event, but it doesn't work. Need to knw why. I'm drawing the scene to the window, but am using an intermediate DC. Then it just shows a white screen, however, if I drop the intermediate DC, it works. I need to know why this fails. Thanks in advance.
Code: ( text )
case WM_PAINT: { HBITMAP hBm = (HBITMAP)LoadImageA(NULL, "black.bmp", IMAGE_BITMAP, 768, 768, LR_LOADFROMFILE); HBITMAP hBmMask = (HBITMAP)LoadImageA(NULL, "blackm.bmp", IMAGE_BITMAP, 768, 768, LR_LOADFROMFILE); HDC ourDC = CreateCompatibleDC(GetDC(hWnd)); HDC comDC = CreateCompatibleDC(ourDC); HDC mDC = CreateCompatibleDC(ourDC); HBITMAP old = (HBITMAP)SelectObject(comDC, hBm); HBITMAP old2 = (HBITMAP)SelectObject(mDC, hBmMask); BitBlt(ourDC, 0, 0, 768, 768, mDC, 0, 0, SRCAND); BitBlt(ourDC, 0, 0, 768, 768, comDC, 0, 0, SRCPAINT); BitBlt(GetDC(hWnd), 0, 0, 768, 768, ourDC, 0, 0, SRCCOPY); } break;
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
|
|
July 24th, 2008 12:37 PM
# 2
|
Re: BitBlt trouble.
a late response it seems. have you found out where the problem was?
i remember having similar problems - some years ago though. did you try to createcompatibledc from the same GetDC?
r.
Not the answer you were looking for? Post your question . . .
182,317 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).
|