Color picking
Moderators: Dorian (MJT support), JRL
-
- Newbie
- Posts: 16
- Joined: Sat Nov 18, 2006 7:19 am
Color picking
is there any easier/faster way to do something like this..
findcolor>(color) or findcolor>(color),startX,startY,endX,endY
mousemove>x,y
Lclick
i understand there's a lib/plugIN in downloads, buts its slow and complicated. and to me, this system is build around being easy to understand and follow. i myself dont know how to make dlls..
could anyone help please?
thanks
jamie
findcolor>(color) or findcolor>(color),startX,startY,endX,endY
mousemove>x,y
Lclick
i understand there's a lib/plugIN in downloads, buts its slow and complicated. and to me, this system is build around being easy to understand and follow. i myself dont know how to make dlls..
could anyone help please?
thanks
jamie
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
This comes up frequently, maybe I need to add this to FAQs. But the answer is to use GetPixelColor inside two nested loops, one for X coords, the other for the Y coords:
Code: Select all
Let>XStart=10
Let>XStop=30
Let>YStart=10
Let>YStop=30
Let>x=XStart
Repeat>x
Let>y=YStart
Repeat>y
GetPixelColor>x,y,color
If>color=ColorToFind
MouseMove>x,y
LClick
Endif
Let>y=y+1
Until>y>YStop
Let>x=x+1
Until>x>XStop
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Newbie
- Posts: 16
- Joined: Sat Nov 18, 2006 7:19 am
-
- Newbie
- Posts: 16
- Joined: Sat Nov 18, 2006 7:19 am
i did a few tests with the current method above.. takes 5-10 seconds, depending on machine to check an area of pixels 100x100..so think is you was doing 500x500, thats 25-50 seconds.. this seems to be a little slow.
ive seen other ''programs'' use commands like:
findcolor(color,x,y) finds color in window sets x,y to cords found
findcolor(color,SRTx,SRTy,ENDx,ENDy,x,y) looks for color in rect of SRTxy and ENDxy, returns x,y as cords found..
these commands work instantly.. is there any way to do this faster with this program? mabie a dll of some sort?
thanks
jamie
ive seen other ''programs'' use commands like:
findcolor(color,x,y) finds color in window sets x,y to cords found
findcolor(color,SRTx,SRTy,ENDx,ENDy,x,y) looks for color in rect of SRTxy and ENDxy, returns x,y as cords found..
these commands work instantly.. is there any way to do this faster with this program? mabie a dll of some sort?
thanks
jamie
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
a FindColor function would still have to have a loop and check each pixel, but, yes, it would be faster as it would all be happening at a lower level, internal to Macro Scheduler. I'll add that to the wish list. But right now in the absence of a built in function, if you want something faster then a custom DLL would be the best solution. Then Macro Scheduler could call the DLL function which could be written in a lower level language and therefore more optimized. We could write you such a DLL. Email support if you are interested.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
But see my comment above, how often are you looking for a single pixel?simplejamie wrote:i did a few tests with the current method above.. takes 5-10 seconds, depending on machine to check an area of pixels 100x100..so think is you was doing 500x500, thats 25-50 seconds.. this seems to be a little slow.
-
- Newbie
- Posts: 16
- Joined: Sat Nov 18, 2006 7:19 am
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Ok, download FindColor.dll here:
http://www.mjtnet.com/plugins.htm
http://www.mjtnet.com/plugins.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi Marcus,
Just wanted to say thanks for FindColor.dll and... I have a question I'm sure you could help with.
I used a colorpicker program to grab the color of an Icon I wanted to detect on the desktop, it told me the color's value was #F5C838.
I then used a web app available here to convert from Hex to decimal and it gave a result of 16107576 however this number did not work with the dll.
Then I used the Macro Scheduler GetPixelColor> command to get the color value and it told me that color was 3721461. Plugging this value into the dll worked.
What I'm wondering is, why didn't 16107576 work? Isn't that the proper conversion from Hex #F5C838 ? Could the colorpicker program be giving false values?
Just wanted to say thanks for FindColor.dll and... I have a question I'm sure you could help with.
I used a colorpicker program to grab the color of an Icon I wanted to detect on the desktop, it told me the color's value was #F5C838.
I then used a web app available here to convert from Hex to decimal and it gave a result of 16107576 however this number did not work with the dll.
Then I used the Macro Scheduler GetPixelColor> command to get the color value and it told me that color was 3721461. Plugging this value into the dll worked.
What I'm wondering is, why didn't 16107576 work? Isn't that the proper conversion from Hex #F5C838 ? Could the colorpicker program be giving false values?
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
It's just a different format. The hex value is an RGB value where:
F5 = red intensity
C8 = green intensity
38 = blue intensity
Note that 38C8F5 converted to decimal is 3712461 ...
Please don't ask me why Windows returns it in the opposite format to what is commonly used in HTML. I don't know. But it's a case of comparing like with like.
Use Macro Scheduler's color locator (it's on the macro properties form, it can follow the cursor, and in 9.0 it's on the Editor toolbar) to get colors that you will use/find within Macro Scheduler. And we won't be reversing the format, as that will cause backward compatibility issues.
F5 = red intensity
C8 = green intensity
38 = blue intensity
Note that 38C8F5 converted to decimal is 3712461 ...
Please don't ask me why Windows returns it in the opposite format to what is commonly used in HTML. I don't know. But it's a case of comparing like with like.
Use Macro Scheduler's color locator (it's on the macro properties form, it can follow the cursor, and in 9.0 it's on the Editor toolbar) to get colors that you will use/find within Macro Scheduler. And we won't be reversing the format, as that will cause backward compatibility issues.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Well... 3721461 actually but I see what you mean... an "RGB" value but formatted backwards... "BRG".mtettmar wrote:It's just a different format. The hex value is an RGB value where:
F5 = red intensity
C8 = green intensity
38 = blue intensity
Note that 38C8F5 converted to decimal is 3712461 ...
I forgot that tool did colors too, very helpful. I'll just use that from now on for this sort of thing.mtettmar wrote:Please don't ask me why Windows returns it in the opposite format to what is commonly used in HTML. I don't know. But it's a case of comparing like with like.
Use Macro Scheduler's color locator (it's on the macro properties form, it can follow the cursor, and in 9.0 it's on the Editor toolbar) to get colors that you will use/find within Macro Scheduler.
I wouldn't dream of asking for that...mtettmar wrote:And we won't be reversing the format, as that will cause backward compatibility issues.
Thanks and take care...
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
I find it more convenient to use (free) ColorPic http://www.iconico.com/colorpic/ for this and HTML purposes, it returns hex codes and decimal color codes that match the Macro Scheduler ones
Hi Me_again,
I tried out ColorPic (Direct download from Downloads.com here). Yes, I see the decimal color codes match the Macro Scheduler ones so that's handy. Also, the magnification feature allows one to easily select the exact color you want, right down to the pixel.... nice. Thank you for taking the time to mention this.
I tried out ColorPic (Direct download from Downloads.com here). Yes, I see the decimal color codes match the Macro Scheduler ones so that's handy. Also, the magnification feature allows one to easily select the exact color you want, right down to the pixel.... nice. Thank you for taking the time to mention this.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -