Sorry, I can't teach you everything from scratch. You have to learn to store (and retrieve) the data somehow. Basic language stuff. Good luck.
Orig. from above
Code:
Private Sub cmdFindColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFindColor.Click
Dim _foundPoints() As Point = ScreenManager.FindColorLocations(_ss, _searchColor)
If _foundPoints(0).X = -1 Then
''fail. todo: add proper documentation. FindColorLocations() returns a single point of (-1,-1) on failure.
MessageBox.Show("No points found of that color.")
Else
Dim _outStr As New System.Text.StringBuilder
For Each pp As Point In _foundPoints
_outStr.Append(pp.ToString & " ") '' displays as {X,Y}
Next
MessageBox.Show(_foundPoints.Length & " points found. " & Environment.NewLine _
& _outStr.ToString)
End If
End Sub
Something Different
Code:
Private Sub cmdFindColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdFindColor.Click
Dim _foundPoints() As Point = ScreenManager.FindColorLocations(_ss, _searchColor)
If _foundPoints(0).X = -1 Then
''fail. todo: add proper documentation. FindColorLocations() returns a single point of (-1,-1) on failure.
MessageBox.Show("No points found of that color.")
Else
For Each pp As Point In _foundPoints
Cursor.Position = pp
Threading.Thread.Sleep(1500) '' so you can actually see it for a moment.
Next
End If
End Sub
Dim _foundPoints() As Point = ScreenManager.FindColorLocations(_ss, _searchColor)
If _foundPoints(0).X = -1 Then
''fail. todo: add proper documentation. FindColorLocations() returns a single point of (-1,-1) on failure.
MessageBox.Show("No points found of that color.")
Else
For Each pp As Point In _foundPoints
Cursor.Position = pp '' move the cursor to each point
Threading.Thread.Sleep(1500) '' so you can actually see it for a moment.
Next
End If
'' Careful. Moving the mouse to 1000+ points will take a long time. JUST AN EXERCISE.
..I'm not giving you an entire framework...the function FindColorLocations() isn't actually that useful. You're more likely interested in knowing if a specific location of the screen is a certain color (the GetPixe() function). It was just to show you some code so you'd have an idea of what it looks like.