Sign in to follow this  
deadimp

Accessing the data in a Direct Context (C++, WinGDI, HDC)

Recommended Posts

deadimp    310
Is there some way to access the pixels in a Direct Context (using the data type HDC as a handle) directly, without creating a buffer?

Share this post


Link to post
Share on other sites
Colin Jeanne    1114
You can use GetPixel() if you dont need speed. You can also select a different bitmap into your DC and the return value of SelectObject() will be a handle to the previously selected bitmap. You can then read the bit data from that using GetDIBits().

Share this post


Link to post
Share on other sites
deadimp    310
Don't those create buffers? I do know that you have to create your own buffer when a bitmap is not created using CreateDIBits(), or something like that...
If there aren't that many solutions out there, I'm probably going to go through with manually loading of bitmaps so I can control everything... Eep.

Thanks.

Share this post


Link to post
Share on other sites
Anon Mike    1098
There's no way to get a pointer directly to bitmap data of the screen if that's what you're asking. You either get pixels one-by-one (real slow) or you copy a region of the screen to a DIB buffer and access them that way.

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