nAutoIT Posted November 29, 2009 Posted November 29, 2009 (edited) I get wrong Results from "PixelGetColor". Example (see attached Screenshot): $chksm = PixelGetColor(780,125) MsgBox(1,"Checksum",$chksm) -The Message Box shows 14343130 -Calc says thats DADBDA -Au3Info says its 0xFFFFFF I am very unexperienced at scripting, so i´m most likely doing something wrong. Au3Info is right, the Pixel is bright White. I am using AutoIT 3.2.10.0 and 2 Monitors. Could that be the Problem? I also get wrong Results using PixelSearch. There are 2 white(0xFFFFFF) Pixels next to each other and PixelSearch shows me the Coordinates of the right one(Help says "search is performed left-to-right"). Example: $coord = PixelSearch(650,25,840,650,0xFFFFFF) MsgBox(1,"x",$coord[0]) MsgBox(1,"y",$coord[1]) Edited November 29, 2009 by nAutoIT
hxhjx Posted November 29, 2009 Posted November 29, 2009 (edited) hi, maybe you "calculated" it wrong or the windows calculater just cant get it. i guess there are also some autoit functions for converting this kind of values. about the two pixels. its true pixelsearch just search 1 pixel. maybe you can tell us what are u searching. the problem with white pixels is that they are not coming in a small amount try to find something more individual then 0xFFFFFF. regards hxhjx Edited November 29, 2009 by hxhjx
nAutoIT Posted November 29, 2009 Author Posted November 29, 2009 Hi hxhjx and thanks for the answer. I doubt that calc is that buggy and definitely 14343130 < FFFFFF. Lets keep it to the PixelSearch Problem. I´m searching the area 650,25,840,650 and there are exactly 17 white Pixels. In my Example the first two of those are at 180,125 and 181,125. The Problem is, that PixelSearch finds 181,125. "$coord[0] -= 1" would be a workaround for this, but i want to understand what i´m doing wrong, because this won´t be the last time i use this command.
Bowmore Posted November 29, 2009 Posted November 29, 2009 The most likely cause of your problem, is that you are using different coord modes in AutoitInfo and your script. Which would mean that the coordinates point to different locations on the screen. In AutoItInfo check Options->Coord Mode And use Opt("PixelCoordMode", ?) to set your script to use the same reference frame "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
jebus495 Posted November 30, 2009 Posted November 30, 2009 Try this? $chksm = PixelGetColor(780,125) MsgBox(1,"Checksum", Hex($chksm, 6)) If that works then it would be your math that's off.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now