Sign in to follow this  

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

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

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

This topic is 4580 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.

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