Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Color Picker
#1
One of my most useful little ten minute programs that I've came up with for a while, though this is for Windows Only:

Code: (Select All)
Dim WinMse As POINTAPI
Type POINTAPI: As Long X_Pos, Y_Pos: End Type

Declare Dynamic Library "User32"
Function GetWindowLongA& (ByVal hwnd As Long, ByVal nIndex As Long)
Function SetWindowLongA& (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long)
Function GetAsyncKeyState% (ByVal vkey As Long)
Function GetCursorPos (lpPoint As POINTAPI)
End Declare
Width 12, 1 'large enough to hold our color value in hex
GWL_STYLE = -16
ws_border = &H800000
WS_VISIBLE = &H10000000
_Title "Color Picker"
hwnd& = _WindowHandle
winstyle& = GetWindowLongA&(hwnd&, GWL_STYLE)
_Delay .2
a& = SetWindowLongA&(hwnd&, GWL_STYLE, winstyle& And WS_VISIBLE)

Color 15
Do
_Limit 30
z = GetCursorPos(WinMse)
_ScreenMove WinMse.X_Pos + 1, WinMse.Y_Pos + 1
tempimage = _ScreenImage
Cls , 0
_Source tempimage: Print Hex$(Point(WinMse.X_Pos, WinMse.Y_Pos));: _Source 0
_FreeImage tempimage
_Display
Loop Until GetAsyncKeyState(1) Or GetAsyncKeyState(2) Or GetAsyncKeyState(27)
System

Run it. Move the mouse around your screen. I think you can tell fairly quickly and easily what it does for you.
Reply


Messages In This Thread
Color Picker - by SMcNeill - Yesterday, 03:53 PM
RE: Color Picker - by Pete - Yesterday, 07:33 PM
RE: Color Picker - by bplus - Yesterday, 08:56 PM
RE: Color Picker - by grymmjack - Yesterday, 09:41 PM
RE: Color Picker - by SMcNeill - Yesterday, 10:41 PM
RE: Color Picker - by Pete - Yesterday, 11:58 PM
RE: Color Picker - by SMcNeill - Today, 12:03 AM
RE: Color Picker - by Pete - Today, 12:50 AM



Users browsing this thread: 6 Guest(s)