Jump to content

AutoIt window spy and PixelGetColor differing?


Recommended Posts

i have a program which reads a color at a pixel using PixelGetColor. i use it in an if statement

If PixelGetColor(403, 483) = 16777089 Then

when i scroll the mouse over that that spot, the number 16777089 is the decimal value i get of that color. the problem is it never enters the if statement. i inserted the code....

$pixel = PixelGetColor(403, 483);

MsgBox(0, "regv", $pixel);

right above the if statement to check out what is going on and almost each time i run the program, $pixel has a different value, even when AutoIt window spy says otherwise. anyone know why this is happening or what causes it. thanks a lot. I appreciate it. I am using AutoIt v3.

Link to comment
Share on other sites

  • Moderators

i have a program which reads a color at a pixel using PixelGetColor. i use it in an if statement

If PixelGetColor(403, 483) = 16777089 Then

when i scroll the mouse over that that spot, the number 16777089 is the decimal value i get of that color. the problem is it never enters the if statement. i inserted the code....

$pixel = PixelGetColor(403, 483);

MsgBox(0, "regv", $pixel);

right above the if statement to check out what is going on and almost each time i run the program, $pixel has a different value, even when AutoIt window spy says otherwise. anyone know why this is happening or what causes it. thanks a lot. I appreciate it. I am using AutoIt v3.

Make sure your Opt('PixelCoordMode') matches your Coord mode that you are using on the AutoInfo tool.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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...