Hi all,
I am using the following code to get the color on the mouseposition:
Function GetScreenPixel(ByVal pt As Point) As Color
Using bmp As New Bitmap(1, 1)
Using g As Graphics = Graphics.FromImage(bmp)
g.CopyFromScreen(pt, Point.Empty, New Size(1, 1))
Return bmp.GetPixel(0, 0)
End Using
End Using
End Function
Private Sub Timer4_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer4.Elapsed
col2 = GetScreenPixel(MousePosition)
TextBox8.Text = col2.ToString & MousePosition.ToString
End Sub
The results appear in the textbox, but not at the right coordinates .
The mouse position is OK, but he colors are only right at the left side of the screen.
How can I fix this?
Thanks in advance,
Groover
I am using the following code to get the color on the mouseposition:
Function GetScreenPixel(ByVal pt As Point) As Color
Using bmp As New Bitmap(1, 1)
Using g As Graphics = Graphics.FromImage(bmp)
g.CopyFromScreen(pt, Point.Empty, New Size(1, 1))
Return bmp.GetPixel(0, 0)
End Using
End Using
End Function
Private Sub Timer4_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer4.Elapsed
col2 = GetScreenPixel(MousePosition)
TextBox8.Text = col2.ToString & MousePosition.ToString
End Sub
The results appear in the textbox, but not at the right coordinates .
The mouse position is OK, but he colors are only right at the left side of the screen.
How can I fix this?
Thanks in advance,
Groover