Biodegradable
Member
- Joined
- Nov 20, 2005
- Messages
- 9
ok I have never messed with GetPixel before so this is my guess at how it supposed to work (I got really close i think) My code:
I realized that Vb.net does not read Hex but RGB. So my problem is how do i get my program to recognize color black, or #000000, or (0,0,0) my friend said something like defing R, G and B as something and then putting those in a form of (0,0,0) so something like GetPixel (hdc,400,400) = (0,0,0) or something like that. how should I do it?
to make it even more complicated I want to put this on a timer
Code:
Public Class Form1
Public Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Integer
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Integer) As Integer
Public Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Integer, ByVal ByValhdc As Integer) As Integer
Private Sub GetPixels(ByVal hdc As Long, ByVal x As Long, ByVal y As Long)
Dim black As Color = Color.Black
Dim hWnd As Integer = GetForegroundWindow()
hdc = (GetWindowDC(hWnd))
If GetPixel(hdc, 400, 400) = black Then
MsgBox("w00t Returned black")
End If
End Sub
End Class
to make it even more complicated I want to put this on a timer
Last edited by a moderator: