Jump to content
  • Advertisement

Archived

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

En3my

Painting in Dialog Window?

This topic is 5993 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
A dialog doesn''t have a client in the same sense as a regular window. Put a static control in the dialog and target that.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!