Skip to main content
GameDev.net gamedev.net
🔒 Locked

How to get game screen pixels (like FRAPS)?

Started by mmakrzem Jul 3, 2009 at 7:27 AM 1 replies 1.6k views
Original Post
mmakrzem
mmakrzem
I would like to build an application that runs in the background while I am playing a game. The application needs to be able to get the current color of selected pixels on the screen. Sort of like screen capture which FRAPS dones. How can I get the color of pixels that are rendered onto the screen from an external application? How is FRAPS able to capture the screen, or any other screen capture software that is out there?
Adam_42
Adam_42
You probably want a proxy DLL. Some old example code can be found at http://www.codeguru.com/cpp/g-m/directx/directx8/article.php/c11453

Note that if you want to be able to handle all applications you'll need several proxy DLLs to hook the various versions of D3D and OpenGL.

If you just want a screen shot then just press the print screen button which grabs an image of the whole screen and puts it in the clipboard.
mmakrzem
mmakrzem
I don't actually want to be pressing print screen because I need my application to be automated. I also do not want to be saving the pixel color data on the screen to the hard drive, I just need to information in memory so that I can perform some calculations on it.

I wonder if I could write a simple Windows program that simulates a print screen key press, have windows capture the data for me and save it in the clipboard and then somehow gain access to the clip board data so that I can extract the pixel data that is on the screen.

This may be a little slow since it would be capturing everything on the screen, but I only want to get about 100 pixels from the screen, nothing more.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.