What I want to do is get my screen into a pixel array(array or rgb structs).

I got a program running that loads a .bmp and does this but I want to skip the manual printscreen and loading and get it straight into an array.

I searched a lot for this but I couldn't find anything this specific.


That was amazingly simple. Thanks.

For anyone searching on google here's all you need to process the pixels on your screen:

COLORREF pixel = GetPixel( GetDC( NULL ), x, y ); 

cout<< (int)GetRValue( pixel );

//GetDC(NULL) is the full screen and x, y are the coordinates
//GetRValue(pixel) gets the red value of the pixel as a byte

GetDC() will return a device context from within its context. So within a CDialog class the method will return a CDC pointer that can be used to paint to the CDialog.