Jump to content

PixelGetColor - wrong colors


Recommended Posts

Hello i have problem with function PixelGetColor. On my computer it working fine but in some cases it not working.

And Im clicking on the active window on red color and it give me the same color still. But in other computers when clicking on the same color red it gives other values and returned color in MsgBox is not red.

Dont know is it a real main thing what causing problem but,

I noticed that problem was on one windows 10.

I have windows 8 and working well. On other windows 10 works well to

Maybe it is caused by windows aero or something like that

How to deal with it?

There is a code

HotKeySet("{PAUSE}", "MouseCord")


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd



Func MouseCord()

    Global $MousePos = MouseGetPos()
    $clickedColor = PixelGetColor($MousePos[0], $MousePos[1])
    MsgBox(0, "Done", $clickedColor)


EndFunc

 

 

Edited by Miliardsto
Link to comment
Share on other sites

  • Developers

If you take the position of the mousepointer and check for the pixel colour, isn't it than likely that it returns the colour of the mouspointer in stead of the color of the original pixel?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Just run the code below. if u click on white color it returns FFFFF if u click on blue it returns blue in rgb, red click returns nearing to FF0000.

As I said in these computers where this function not working it returns always other color if u clicking the same color.

 

 

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Timers.au3>
#include <MsgBoxConstants.au3>
#include <TabConstants.au3>
#include <ColorConstants.au3>

HotKeySet("{PAUSE}", "MouseCord")


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd



Func MouseCord()

    Global $MousePos = MouseGetPos()
    $clickedColor = Hex(PixelGetColor($MousePos[0], $MousePos[1]))
    MsgBox(0, "Done", $clickedColor)


EndFunc

 

Link to comment
Share on other sites

11 hours ago, Miliardsto said:

 

for what reason? what u want see. 10 screenshots when i click on the same position and it gives differents colors?

 

Yes! There IS a reason, and I want to see it! 

You asked for help and support us with...nothing. Waste our time is not very solution-oriented...

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

and Miliardsto refuses to give the name of the application. So, I have no choice but to assume it is for a game and that is against forum rules. Time to put up or stop. The name of the application you are wanting to automate please.

Edited by Bert
Link to comment
Share on other sites

  • Developers
52 minutes ago, Miliardsto said:

lol . it not solve the problem. its not problem in 3 pixels right or down. 

 

cLICK ON THE same color - still same color - gives different colors

I will do a *click* for this threat as it seems all important information is exchanged that you are willing to share.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...