Fredledingue Posted August 5, 2004 Share Posted August 5, 2004 Hi, First of all, a big thanks for AutoItx3! I just start to use it in my vbscripts. I tried to use the PixelGetColor method. It returns a number that seems totaly random to me: I expected it to returns the RGB values but it doesn't. It also doesn't work on overlay windows: If you play a video and try to get a pixel color value from inside the video window, it will always returns the same number. I wanted to use this tool to detect automaticaly the color in an overlay window, to see if it's totaly black, totaly pink, totaly blue or if something is playing... Link to comment Share on other sites More sharing options...
this-is-me Posted August 5, 2004 Share Posted August 5, 2004 (edited) That is because video overlays are hardware accelerated by the video card. If you hit printscreen, go to mspaint and paste, you will see exactly what autoit sees. Edited August 5, 2004 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
pekster Posted August 5, 2004 Share Posted August 5, 2004 I tried to use the PixelGetColor method. It returns a number that seems totaly random to me: I expected it to returns theĀ RGB values but it doesn't. <{POST_SNAPBACK}>You are seeing the decimal representation of the hex number. You could convert it to hex to get the RGB components, but that is rarely needed. Just enclose the color you wish to test against in quotes (like this: "FF00FF") or use the hex number to compare it (like this: 0xFF00FF). You could also test using the decimal number that the AU3_Spy window returns. There's not a lot of point to this other than to obfuscate your code. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
this-is-me Posted August 6, 2004 Share Posted August 6, 2004 There is more to it than that. On a video overlay, it will always show up as black "000000". Who else would I be? Link to comment Share on other sites More sharing options...
pekster Posted August 6, 2004 Share Posted August 6, 2004 There is more to it than that. On a video overlay, it will always show up as black "000000". <{POST_SNAPBACK}>Take a screenshot, paste it into any image editing software, and you'll see why. 0x000000 = 0 = black. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 6, 2004 Administrators Share Posted August 6, 2004 AutoItX probably still returns BGR. I'm going to do some AutoItX hacking today to try and bring it up to date. Deployment Blog:Ā https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming:Ā https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
this-is-me Posted August 6, 2004 Share Posted August 6, 2004 @pekster, DUH!!! RTP!!! [READ THE POST] Does nobody read the posts? You don't have to tell me that, I told him that. DUH. Who else would I be? Link to comment Share on other sites More sharing options...
pekster Posted August 6, 2004 Share Posted August 6, 2004 @pekster, DUH!!! RTP!!! [READ THE POST] Does nobody read the posts? You don't have to tell me that, I told him that. DUH. <{POST_SNAPBACK}>Somehow I thought that he posted that, not you. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
this-is-me Posted August 6, 2004 Share Posted August 6, 2004 No problem, I just get a little steamed having to restate myself. Who else would I be? Link to comment Share on other sites More sharing options...
Fredledingue Posted August 7, 2004 Author Share Posted August 7, 2004 So no way it can check the color of overlay windows.... Anyway this feature can be very useful for (still) image processing automation. You can also play a video in non overlay window if you open a first video before. Then the second video (playing at the same time as the first) won't be in overlay. I will try it as soon as the update is released. It will be cool to have something like 120;85;12 instead of 54236... 8) Link to comment Share on other sites More sharing options...
sugi Posted August 10, 2004 Share Posted August 10, 2004 (edited) Use this code: Func DecodeRGB($RGBValue) DIM $Colors[3] $RGBValue = Hex(Number($RGBValue), 6) $Colors[0] = Dec(StringMid($RGBValue, 1, 2)) $Colors[1] = Dec(StringMid($RGBValue, 3, 2)) $Colors[2] = Dec(StringMid($RGBValue, 5, 2)) Return $Colors EndFunc Returns an array containing the R, G and B value as [0], [1] or [2]. Edited August 10, 2004 by sugi Link to comment Share on other sites More sharing options...
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