getdibits

GetDIBits and loop through pixels using X, Y

末鹿安然 提交于 2019-11-26 09:59:20
问题 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