February 23rd, 2010, 02:25 PM
Pixel date -> HDC
I need to be able to have a drawing behind a variety of native windows controls. I really want to use OpenGL because I'm familiar with OpenGL and it's hardware accelerated. I know that I can't draw my OpenGL functions directly to my main window because OpenGL on windows requires a dedicated HWND, so I got the idea to do my OpenGL rendering to a hidden HWND and use glReadPixels to get the raw pixel data.
Now I'm stuck. Is there a way to blit raw data onto an HDC? Or am I going to have to go through hoops to get this to work. I've been Googling for half an hour and haven't found a function to do what I want.
February 24th, 2010, 02:37 AM
Re: Pixel date -> HDC
I'm not an OpenGL expert, but you could: 1) simply get your hidden window HDC and BitBlt it to the target HDC or 2) if you need to access raw data, you can create a divice indipendent bitmap and BitBlt the openGL window into it, modify data, then BitBlt to target HDC.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.