HDC WindowDC = GetDC(hwnd);
HDC TempDC = CreateCompatibleDC(NULL);
HBITMAP bmp = LoadBitmap(hinstance, MAKEINTRESOURCE(ID_BITMAP));
SelectObject(TempDC, bmp);
BitBlt(WindowDC, 0, 0, 640, 480, TempDC, 0, 0, SRCCOPY);
DeleteObject(TempDC);
I don''t receive any compile errors, it just won''t blit. Any ideas? Am I forgetting something?
I use the following code to do a blit operation in GDI but it won''t blit anything.
I''m assuming you''re releasing the device context for the window after you finish and just didn''t include it in the code, but if you didn''t release it, that would definately cause a problem which might result in BitBlt not working. However, other than that, I see no problems with your code.
Could somebody take a look at my code if I were to send it, because I cannot figure this out? Something is preventing BitBlt and I can''t figure out what it is.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement