|
-
Oct 21st, 2000, 02:58 AM
#1
Thread Starter
Junior Member
hiya all,
I would like to know how I would be able to find the colour that is underneath the cursor. eg same as in Photoshop where you can set a colour by putting your mouse over the colour you want.
But I want to be able to do this over the desktop and over other programs.
I have no idea on how to do this and any help would be most apreashiated.
Thanks
-
Oct 21st, 2000, 04:36 AM
#2
transcendental analytic
Code:
'Put all this in a module
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Declare Function GetDesktopWindow Lib "user32" () 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
Function coloratcursor() as long
Dim pa As POINTAPI
GetCursorPos pa
coloratcursor = GetPixel(GetWindowDC(GetDesktopWindow), pa.X, pa.Y)
End Function
OnColorClick 50, 100, vbYellow
And call Coloratcursor and it will return the color
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 21st, 2000, 05:24 AM
#3
Thread Starter
Junior Member
thanks
thanks..
that is what i was after
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|