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

Started by
4 comments, last by deadimp 18 years, 10 months ago
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?
Projects:> Thacmus - CMS (PHP 5, MySQL)Paused:> dgi> MegaMan X Crossfire
Advertisement
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.
Projects:> Thacmus - CMS (PHP 5, MySQL)Paused:> dgi> MegaMan X Crossfire
GetPixel() does not create a buffer.
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.
-Mike
Alright. Thanks for y'all's help.
Projects:> Thacmus - CMS (PHP 5, MySQL)Paused:> dgi> MegaMan X Crossfire

This topic is closed to new replies.

Advertisement