How would I make a DC that I could do GDI funtions on and then BitBlt to the window DC when the WM_PAINT is recieved? I tried CreateCompatibleDC but when I BitBlt it is blank... ------------- WM_CREATE: GetDC,hWnd CreateCompatibleDC,eax mov wDC,eax Rectangle,wDC,25,25,50,50 WM_PAINT: BeginPaint,hWnd,lpPaint mov hDC,eax BitBlt,hDC,0,0,100,100,wDC,0,0,SRCCOPY EndPaint,hWnd,lpPaint -------------
Posted on 2000-12-22 20:28:00 by dork
You're on the right track. Think of a DC as an artist's easel, it still needs a canvas to hold the picture. That canvas is the bitmap. CreateCompatableDC does create a bitmap, but it's only 1x1 pixel. Kinda useless. So, after you create the DC, CreateCompatibleBitmap and select that into the DC. Don't forget to restore the orgional 1x1 bitmap before you destroy the DC (and then destroy the bitmap)
Posted on 2000-12-22 21:01:00 by Ernie