Sign in to follow this  
uncle_rico

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this