Jump to content
  • Advertisement
Sign in to follow this  
wind_addict

BitBlt question

This topic is 3895 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

Have a simple question, can I only use BitBlt() within the WM_PAINT message? As it only seems to draw a black window if I try and use it outside of that. I have tried doing this in a seperate function: BitBlt from a loaded bmp in a memory DC to my primary memory dc. then under WMPAINT I blit from that primary memory dc to the screen but only get a black window. If I instead do the same thing in the WMPAINT block, it works fine.

Share this post


Link to post
Share on other sites
Advertisement


while(true)
{
if(PeekMessage(&msg,NULL,0,0, PM_REMOVE))
{
if(msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}

BitBlt(hdcmem, 0, 0, 200, 200, bmp[HBMT54].GethDC(), 0, 0, SRCCOPY);


If I put the same line of code in a WM_PAINT it works. hdcmem is initialised prior to entering the message loop.

Share this post


Link to post
Share on other sites
You guys basically answered my question in that you CAN use BitBlt outside of WM_PAINT.

I figured it out now. I was releasing the screen DC too soon.

thanks!


[Edited by - wind_addict on November 22, 2007 6:03:41 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!