0

I want to do a screenshot of a GUI window from C/C++ into the memory. It would be really nice if it's a two dimension array of RGB values or something similar.

Im at the moment searching for a Linux based solution, but would be nice if there is a platform independent solution.

Andrejs Cainikovs
  • 27,428
  • 2
  • 75
  • 95
Roby
  • 2,011
  • 4
  • 28
  • 55
  • By snapshot you mean screenshot, right? Or the actual memory dump of a given program? – Andrejs Cainikovs Apr 03 '14 at 09:43
  • @AndrejsCainikovs yes – Roby Apr 03 '14 at 09:44
  • "Platform-independent" -- no way. To do so, you'd need a direct link into the graphics hardware, and that differs from one video card to the other. That's why different OS's have different kinds of video drivers -- to shield you from all the low-level stuff. – Jongware Apr 03 '14 at 10:33

1 Answers1

0

You could utilize xlib for Linux: How do take a screenshot correctly with xlib?

And GDI on Windows: MSDN - Capturing an Image

Community
  • 1
  • 1
Andrejs Cainikovs
  • 27,428
  • 2
  • 75
  • 95