title: How do I get a 2D array of pixels from the desktop and/or a window in windows in c++?
body: <p>I'm trying to get a 2D array of pixels from an area of the screen of my choice so I can use it in my program. In short, like taking a screenshot without exporting the data into an image.
  I would also like to find out do this in both a window and on the desktop. Any help would be appreciated. (I've created an example image to clarify my question. see picture below)
  <a href="https://i.stack.imgur.com/biawY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/biawY.png" alt="enter image description here" /></a></p>