Accessing the data in a Direct Context (C++, WinGDI, HDC)
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?
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().
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement