Hello,
Is it possible for my Xojo app to be able to detect the Hexadecimal value of the colour below my mouse cursor, when the cursor is outside of my app (basically anywhere on the screen)?
Could someone point me in the right direction to where I would begin.
Thanks Michel.
I am still a bit confused on that, but when I eventually get around to attempting this - I will take a deeper look.
Thank you for trying to help - I appreciate it.
Edit: To use - make sure the app has focus then press the return/enter key to trigger the button. The code will break into the debugger at the break point with a variable containing the color. You could copy the code in the Action event of the button into a method which is called by whatever needs to determine the color.
Jason - thank you so much, I will study that and work out what is happening, and learn from it
Just one question - if I move my mouse over a window of another app, and then press enter, the colour copied to the clipboard is the colour of my wallpaper, and not of the window colour?
Is that expected behaviour?
It seems to ignore everything on my screen except the wallpaper.
That’s interesting - it worked when I tried it with Safari and Xojo. Maybe take a look at the picture from the clipboard, p, and see if it is capturing the screen as expected or just your wall paper?
Jason,
I put my mouse over a blue coloured button on a window of another app, and then pressed enter.
I just pasted the clipboard content into an empty text file, and an image of my entire screen was pasted in.
When I look at the debugger however - I see the following:
This seems to have copied the green from the part of my wallpaper which was below the blue button??
Upon further testing, you are correct. It seems mousex and mousey are not returning the true mouse coordinates. This is fixed by changing the mousex and mousey to system.mousex and system.mousey.
you really want to launch a shell tool, edit the clipboard and take a full screenshot just for getting one pixel?
Sounds like a big waste of resources and users may blame you for altering their clipboard…