Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need eyedropper app
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
OS:
Windows 7
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01539913
Message ID:
01540548
Views:
54
http://www.codeguru.com/vb/gen/vb_graphics/article.php/c2357/A-method-to-get-the-pixel-color-under-the-mouse-pointer.htm
DECLARE INTEGER GetPixel     IN gdi32.DLL INTEGER , INTEGER, INTEGER
DECLARE INTEGER GetCursorPos IN user32.DLL STRING @
DECLARE INTEGER GetWindowDC  IN user32.DLL INTEGER

PUBLIC poTMR
poTMR=CREATEOBJECT("_tmr")

_Screen.AddObject("txtX","textbox")
_Screen.AddObject("txtY","textbox")
_Screen.AddObject("txtC","textbox")

WITH _Screen.txtX
.Top=10
.Visible=.T.
ENDWITH

WITH _Screen.txtY
.Top=40
.Visible=.T.
ENDWITH

WITH _Screen.txtC
.Top=70
.Visible=.T.
ENDWITH


DEFINE CLASS _tmr AS TIMER
   Interval=100
   Enabled=.T.

   PROCEDURE TIMER
      LOCAL liDC,lcPOINT,liColor,liX,liY
      lcPOINT=REPLICATE(CHR(0),8)
      
      liDC = GetWindowDC(0)
      =GetCursorPos(@lcPOINT)
      
      liX=CTOBIN(LEFT(lcPOINT,4),"RS")
      liY=CTOBIN(RIGHT(lcPOINT,4),"RS")
      liColor = GetPixel(liDC, liX, lIY)
      
      _Screen.txtX.Value=liX
      _Screen.txtY.Value=liY
      _Screen.txtC.Value=liColor
   ENDPROC
  
ENDDEFINE  
MartinaJ

>>>Does anyone know of a VFP eyedropper app that will allow the user to select the color from a point anywhere on the screen even outside the currently running VFP app and return the color to the VFP app?
>>>Thanks.
>>
>>Maybe this link can get you started.
>>http://www.foxite.com/downloads/default.aspx?id=179
>>
>>Regards,
>>Pieter
>
>
>Pieter,
>thanks a million. With just a small amount of tweaking this will sure do the job. It even converts to Hex which is exactly what I need.
>
>John.
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Reply
Map
View

Click here to load this message in the networking platform