Currently the code I have been using is similar to this:
Obviously this is highly inefficient having to scan each pixel on screen individually, not to mention extremely slow and resource heavy.
Any other way to find a certain pattern of pixels on the screen (or in an image ect.) without having to scan each separately?
Any help appreciated.
-Thanks!
Code:
Dim img As Bitmap 'Image we are scanning
For xCoord = 1 To img.Width - 1 'Running though each pixel in each row
For yCoord = 1 To img.Height - 1 'Running through each row
If img.GetPixel(xCoord, yCoord) = Color.Brown Then 'First Pixel that matches
If img.GetPixel(xCoord + 1, yCoord) = Color.Black Then 'Second matching, the one right next to the first
If img.GetPixel(xCoord + 1, yCoord + 1) = Color.Red Then 'Third matching, the one below and to the right of the first
XPix = xCoord 'The three pixels match up in the correct pattern
YPix = yCoord 'Recodring their location
End If
End If
End If
Next
Next
Any other way to find a certain pattern of pixels on the screen (or in an image ect.) without having to scan each separately?
Any help appreciated.
-Thanks!