I'm grabbing a portion of the screen and scanning through the pixels for a certain color range.
I looked at MSDN's Capturing an Image example and know how to use the functions.
I can get the bits into an array, but I'm not sure how to do it in such a way that I can loop through it as I would an image. A pseudo-example (which I'm sure is way off):
for ( x = 1; x <= Image.Width; x += 3 )
{
for ( y = 1; y <= Image.Height; y += 3 )
{
red = lpPixels[x];
green = lpPixels[x + 1];
blue = lpPixels[x + 2];
}
}
That's basically what I want to do, so if red, blue, and green is a certain color, I'll know what coordinate it's at (x, y) in the image.
I just don't know how to use GetDIBits in such a way, and how to setup the array appropriately to be able to accomplish this.