Jump to content
  • Advertisement
Sign in to follow this  
uncle_rico

[GDI] Does anyone know how to create a memory DC that is not 1x1 monochrome?

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

...without loading a bitmap, that is? When I create a memory DC and make it compatible with the DC of my window, it makes it compatible in the sense that it has the same functionality, but according to MSDN, the DC is only 1x1x1-bit. Is there a way to just specify the dimensions and bit depth that I want? It seems that the only way to do that is to load a bitmap into it which, itself, has the pixel dimensions and bit depth that I need. I can load a blank bitmap if needed, but I'd rather not because it seems like a hack.

Share this post


Link to post
Share on other sites
Advertisement
Selecting a bitmap into the DC is actually the way to go.

The DC is merely a interface that lets you draw stuff to something, but A DC isn't a drawing target by itself. If you are drawing to the screen, it has the screen as drawing target, but if you want to draw to an offscreen target, you have to create this drawing target yourself, as a bitmap.

Share this post


Link to post
Share on other sites
I'm using MFC, by the way, and it looks like the CreateBitmap method of CBitmap will allow me to do exactly what I'm looking for. Thanks!

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!