Archived

This topic is now archived and is closed to further replies.

En3my

Painting in Dialog Window?

Recommended Posts

Hi, How do I BitBlt a bitmap into the client area of a Dialog Window? To BitBlt something into the main window I use this piece of code:
  

HDC hdc, memdc;
hdc = BeginPaint(hwnd, &paintstruct); // 

memdc = CreateCompatibleDC(hdc);
SelectObject(memdc, hbit);
vRenderWhatever(hdc, memdc); // To display DC from bitmap DC

DeleteDC(memdc);
EndPaint(hwnd, &paintstruct);
  
Let''s say that I want to blit to a dialog window instead in a similar way, how would I do that? Any special procedures or I just get a handle to the Dialog window, and do my rendering from there? What about the client area? I am a bit confused here, so all help is much appreaciated. What I am doing is a tilebased game, and I have a dialog box for selecting what level to play, and I want to preview a small level map there, hence blitting a small level map to the dialog window. Do I need to set up a particular area of the dialog window for holding the bitmap, or I am free to Blt wherever I want? Thanks for the help!!! No MFC as you can see...

Share this post


Link to post
Share on other sites
Thanks a lot for pointing me in the right direction, I had some problems getting it to work but everything is fine now! Thank you!

Share this post


Link to post
Share on other sites
Cool! I''m glad it worked. It''s been a while since I had a need to blit to a dialog and I wasn''t completely certain that was how I worked it out.

Share this post


Link to post
Share on other sites