Jump to content

reading out pixel and mouse pos


Recommended Posts

Hi there!

I want to write a small programm to read out the absolute mouse pos and the color of the pixel of this pos and show this in a box that is always on top

I know

how to read out pixel color

how to read out mouse pos

and to show it in a msg box

my problem is to bring this to a msg box that actualize with mouse movment, dont find in autoit help something useful for me.

Can someone Help me pls

Edited by SilverBlue
Link to comment
Share on other sites

try

Opt("MouseCoordMode", 1)
HotKeySet("{PAUSE}", "Terminate")

While 1
    $pos = MouseGetPos()
    ToolTip("Desktop X: " & $pos[0] & ", " & _
            "Desktop Y: " & $pos[1] & @CRLF & _
            PixelGetColor($pos[0], $pos[1]) & " Pause2exit")
    Sleep(10)
WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

You are welcome.

The ToolTip will go off screen. There are ways around that, but you might want to try TrayTip:

Opt("MouseCoordMode", 1)
HotKeySet("{PAUSE}", "Terminate")

While 1
    $pos = MouseGetPos()
    TrayTip("", "X: " & $pos[0] & ", " & _
            "Y: " & $pos[1] & " Color: " & _
            PixelGetColor($pos[0], $pos[1]), 10)
    Sleep(10)
WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...