Jump to content
Sign in to follow this  
SilverBlue

reading out pixel and mouse pos

Recommended Posts

SilverBlue

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

Share this post


Link to post
Share on other sites
SilverBlue

Yes this i know already, but my msg box dont actualize with mouse movment, thats my Problem

:)

Share this post


Link to post
Share on other sites
herewasplato

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]

Share this post


Link to post
Share on other sites
SilverBlue

Wow thats realy cool better than i had in mind :D

I tried with tooltip, but i think i didnt use it correct, it only blinked up one time then dont come again.

Realy thx

:)

Share this post


Link to post
Share on other sites
herewasplato

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]

Share this post


Link to post
Share on other sites
SilverBlue

This is good too , but other is better for me, my tray crashed after using Traytip for a while.

:)

Share this post


Link to post
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
Sign in to follow this  

×