Hi all i am using this code to get Pixel Color Outside my form. Now i need to move the mouse around and it shows the pixel color for me in textbox and picture box of my app.
What i want to do add a mouse pointer to this app so i just click on part of any application and it just monitors that part for me all the time and remembers that cordinate of screen. in another word the app some how should remember all the time what postion of screen to look for Pixel Color at by only once clickiing on the spot. I be happy if some one show me how i can add that option to this app.Thanks
I anotherword monitoring fixed screen position's/point's Pixel Color Outside my form.
VB Code:
Dim z As POINTAPI Private Sub Timer1_Timer() GetCursorPos z screendc = CreateDC("DISPLAY", "", "", 0&) 'replace the line below with: Text1 = Hex(GetPixel(screendc, z.x, z.y)) 'if you want that the text box will show the Hex value of the color (the Hex value is 'used to define colors in HTML) Text1 = GetPixel(screendc, z.x, z.y) Picture1.BackColor = GetPixel(screendc, z.x, z.y) DeleteDC (screendc) End Sub module code: Declare Function CreateDC& Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, _ ByVal lpDeviceName As String, ByVal lpOutput As String, lpInitData As Any) Declare Function DeleteDC& Lib "gdi32" (ByVal hdc As Long) Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, _ ByVal y As Long) As Long Type POINTAPI x As Long y As Long End Type Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long


Reply With Quote