Sign in to follow this  
Followers 0
chenxu

Problem or Feature Requests About PixelGetColor Function

5 posts in this topic

#1 ·  Posted (edited)

Context:

I've wrote a project to analyze some text from a picture, shown as figure1 as follow:

As you saw, this is a validating code for some further action in a web page. It's done by other macro tool called Macro Express(we call this as M.E.). I use M.E. to get the pixels of this picture, if the pixel's color is white, I append a <WhiteSpace> to a variable, if the pixel's color is not white, I append a '*' to the variable, and then, move to next pixel and do the same job while all the pixels of the picture are all processed. And after this, I got a variable represent to the text of picture like this:

I write this variable to a text file which will be later processed by my java program. The program will read this file into memery and output the text Z4Z88 into another file to further using.

What I am gonna do...

I found and learnt AutoIt, and I found this is greate macro tool, so I decide to migrate the macro which is already done by M.E. to AutoIt.

The function getting the pixels in AutoIt is PixelGetColor. I found that if the area I am gonna get is covered by some other program, like figure2 shows:

PixelGetColor can not get what actully what I need, and my analyzing program would faild to analyze Z4Z88 with an "error" instead, and the next step of my macro will be failed.

I am wondering that can PixelGetColor get the specified window pixel color but the things shown on the screen. How can I do this now with AutoIt, or is it prossible to do this in the later version? I do think this feature is very important and I hope we can use it now or later.

If PixelGetColor can not got the specified window pixel color but the things shown on the screen, is there any advice on avoiding the sensitive area of the picture being covered by some other program? Thank very much.

Edited by chenxu

Share this post


Link to post
Share on other sites



I am wondering that can PixelGetColor get the specified window pixel color but the things shown on the screen. How can I do this now with AutoIt, or is it prossible to do this in the later version? I do think this feature is very important and I hope we can use it now or later.

If PixelGetColor can not got the specified window pixel color but the things shown on the screen, is there any advice on avoiding the sensitive area of the picture being covered by some other program? Thank very much.

Egad! Stop shouting... you're hurting my ears eyes!

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Context:

I've wrote a project to analyze some text from a picture, shown as figure1 as follow:

As you saw, this is a validating code for some further action in a web page. It's done by other macro tool called Macro Express(we call this as M.E.). I use M.E. to get the pixels of this picture, if the pixel's color is white, I append a <WhiteSpace> to a variable, if the pixel's color is not white, I append a '*' to the variable, and then, move to next pixel and do the same job while all the pixels of the picture are all processed. And after this, I got a variable represent to the text of picture like this:

I write this variable to a text file which will be later processed by my java program. The program will read this file into memery and output the text Z4Z88 into another file to further using.

What I am gonna do...

I found and learnt AutoIt, and I found this is greate macro tool, so I decide to migrate the macro which is already done by M.E. to AutoIt.

The function getting the pixels in AutoIt is PixelGetColor. I found that if the area I am gonna get is covered by some other program, like figure2 shows:

PixelGetColor can not get what actully what I need, and my analyzing program would faild to analyze Z4Z88 with an "error" instead, and the next step of my macro will be failed.

I am wondering that can PixelGetColor get the specified window pixel color but the things shown on the screen. How can I do this now with AutoIt, or is it prossible to do this in the later version? I do think this feature is very important and I hope we can use it now or later.

If PixelGetColor can not got the specified window pixel color but the things shown on the screen, is there any advice on avoiding the sensitive area of the picture being covered by some other program? Thank very much.

Yes...please...no shouting...especially in red (I have a headache right now and wow...it hurts my head).

Ok, I have to try to understand what you are looking for. Are you saying that you want PixelGetColor to be able to get pixels of a graphic even if it is covered by another window? The default Pixel settings refer to the entire screen. I you want the pixels of a specific window, then you could try changing the PixelCoordMode. See the settings below I copied from the help file.

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

However, I haven't used PixelGetColor myself and it still may only be able to get Pixels that you see on the screen and not things that are covered up. The PixelCoordMode may only change your point of reference.

More info and help from someone who has used PixelCoordMode would help.


Be open minded but not gullible.A hammer sees everything as a nail ... so don't be A tool ... be many tools.

Share this post


Link to post
Share on other sites

0 = relative coords to the active window

1 = absolute screen coordinates (default)

2 = relative coords to the client area of the active window

I've tried these options, but it's not help :)

Share this post


Link to post
Share on other sites

I've tried these options, but it's not help :P

Even if you use a different PixelCoordMode, it will still be based on the ACTIVE window. So just WinActivate() the window with the graphic you are interested in, so it will come to the top of the z-order and not be under other windows.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0