gameshow Posted June 24, 2005 Posted June 24, 2005 Correct me if i'm wrong. If the cursor is over the pixel that is being pinged for PixelGetColor() it will get the color of the pixel UNDER the cursor. Is there any way that i can get the color of the pixel, even if the cursor is in the way? In other words, if the cursor is in the way, and i PixelGetColor on top of it, it will return the color of the pixel of the cursor?
Moderators SmOke_N Posted June 24, 2005 Moderators Posted June 24, 2005 Not if your using Opt("PixelCoordMode", 0) for active window then your PixelGetColor(x, y) coords. So example: Opt("PixelCoordMode", 0) WinActivate("Window your trying to get color") $PixelColor = PixelGetColor("x", "y"); don't use "" marks w/ coords MsgBox(0, "Your Pixel Color Is", $PixelColor) Hope this helps. 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.
Moderators SmOke_N Posted June 24, 2005 Moderators Posted June 24, 2005 PixelGetColor gets the color of a pixel within a DC (device context?). The mouse pointer is not part of any device context... I believe, so it is ignored.Lar.<{POST_SNAPBACK}>Or to get really technical -- What Lar said!! Hey Larry 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.
gameshow Posted June 24, 2005 Author Posted June 24, 2005 Or to get really technical -- What Lar said!! Hey Larry<{POST_SNAPBACK}>So is there simply no way to do what i'm trying to do? ( Which is, essentially, get the color of the cursor )
Moderators SmOke_N Posted June 24, 2005 Moderators Posted June 24, 2005 This should work: $coord = MouseGetPos() $pixel = PixelGetColor($coord[0], $coord[1]) MsgBox(0, "Mouse Pixel Color is: ", $pixel) 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.
JSThePatriot Posted June 24, 2005 Posted June 24, 2005 This should work:$coord = MouseGetPos() $pixel = PixelGetColor($coord[0], $coord[1]) MsgBox(0, "Mouse Pixel Color is: ", $pixel)<{POST_SNAPBACK}>As Larry said that will only get the color of the pixel under the mouse. Not of the mouse itself.I am not sure if there is a way to get the color of the mouse at all. You could always check to see what cursor is being used atm with GUI functions.Maybe if you could tell us why you need this we could come up with another solution for you.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
gameshow Posted June 24, 2005 Author Posted June 24, 2005 Maybe if you could tell us why you need this we could come up with another solution for you.JS<{POST_SNAPBACK}>Well, i'm trying to detect cursor changes in a video game to automate some things.
JSThePatriot Posted June 24, 2005 Posted June 24, 2005 I dont know that there is another way around this to detect some other process other than the changing of the cursor, because I do not believe this is possible at all. Thanks, JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)
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