I'm working on writing some automation code and I'm running into a problem finding an efficient way to examine the pixels that presently exist on the display.
I've familiarized myself with the GetPixel function that exists in the gdi32 library, but it's too slow (in fact it takes about 10 seconds just to scan a line of about 1900 pixels).
I've kicked the idea around of making a bitmap out of segments of the graphics device context and testing if this is more efficient (which I can't imagine it would be, considering it would take a lot of r/w to stay reasonably current with the screen image), but before I do that I'd like to know if anyone has any better ideas.
What I'd really love is an efficient way to gather a 2 dimensional array of pixel colors in some or all of the present (or reasonably close to present) graphics context, hopefully using .NET.