GetPixelColor is kinda bugged...
Posted: December 13th, 2004, 10:13 am
Well, this is not a new issue, I actually found the same problem when I was scripting SWG, but I thought I'd throw it out there again if there is something Admin/Wyv can do?
Here is the problem, the GetPixelColor() doesn't always return the right colors when it is reading from a "window" in game.
There is a quick way to reproduce the problem and that is to run the GetPixelColorDemo.vbs that comes with XU.
Go into EQ2 and put your cursor over the health bar of your character (will have to move away from the pop-up tip). Just leave it there and watch the color value swtich between the real colors and something else (usually 0, 0, 0, but can be anything).
I found this when coding SWG and rewrote my health/power bar functions to work around this by checking a pixel multiple times if it didn't match what was expected... and think it is pretty reliable now even in EQ2.
The problem is the more we rely on the function to get colors the more it will become a problem, especially if using to bitmap checks until we have other functions that do that.
I have found the problem does not happen if you are not reading from an in-game window. So, my theory is somehow the GetPixelColor() function is not in sync with the game redraw and when reading from a window in-game, it sometimes reads what is "behind" the window instead of the actual window color (health bar, etc.)
Any ideas?
Rich
Here is the problem, the GetPixelColor() doesn't always return the right colors when it is reading from a "window" in game.
There is a quick way to reproduce the problem and that is to run the GetPixelColorDemo.vbs that comes with XU.
Go into EQ2 and put your cursor over the health bar of your character (will have to move away from the pop-up tip). Just leave it there and watch the color value swtich between the real colors and something else (usually 0, 0, 0, but can be anything).
I found this when coding SWG and rewrote my health/power bar functions to work around this by checking a pixel multiple times if it didn't match what was expected... and think it is pretty reliable now even in EQ2.
The problem is the more we rely on the function to get colors the more it will become a problem, especially if using to bitmap checks until we have other functions that do that.
I have found the problem does not happen if you are not reading from an in-game window. So, my theory is somehow the GetPixelColor() function is not in sync with the game redraw and when reading from a window in-game, it sometimes reads what is "behind" the window instead of the actual window color (health bar, etc.)
Any ideas?
Rich