Sign in to follow this  
Followers 0
hlstriker

Pixelsearch outline on screen? HELP!

4 posts in this topic

Does anyone know how to make an outline appear on the screen above all the windows on the spot the coords are?

In other words, the spot my pixelsearch is, a square/rectangle would appear on the screen showing where the coords are.

I hope you all understand what I mean, I can't really explain this that well :P

Thanks in advance!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Please try the attached script. It has a lot of comments to read, but I think that it will do what you want. I'm sure that a script like this has been written before (and coded better than my version).

I might add a magnifier some day...

Or you can use the one built into the AutoIt Window Info tool:

start the tool

select Options > Magnify

minimize the tool's main window

run the attached script to completion...

exit the AutoIt Window Info tool

[Edit2: The mag'd window may die and require system restart to get back.]

The output of the attached script is a PixelSearch line of code that you can paste into your script.

Let me know if this script works for you or if I misunderstood your request.

Edited for clarity - or not

Edit3: Moved attachment to this post:

http://www.autoitscript.com/forum/index.php?showtopic=19722

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

What a fun script plato!! Nice Job.

Edit:

If I'm understanding HLStriker, he's looking for a Rectangle outlining his chosen search pattern on a specific window. The border would be there on the rectangle but the inside would be transparent, which would be where the pixelsearch would take place is inside the transparent part or within the outlineing border.

So if his script calls for a PixelSearch in the "MainWindow", a rectangle border would show on the main window where he is going to search, however making sure that he is checking the main window, and not the newley made 'splashimage' or 'GUI'.

CyberSlug at one time had a working example of something like this, but since then the upload had been deleted. I tried to do this once myself but failed miserably. It's almost like you would have to have 4 GUI's with borders inter-connected to make one rectangle based on the 4 x and y coords of PixelSearch().

With all the DLL work that Larry has been doing with GUI's, I'm almost certain that something like this could be done easily.

Edited by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

What a fun script plato!! Nice Job.

Edit:

If I'm understanding HLStriker, he's looking for a Rectangle outlining his chosen search pattern on a specific window......

Thank you, but alas - I think that you are correct. hlstriker wants to add an outline to an existing script.

I remember now; that interpretation of hlstrikers post came to me in the wee hours of the morning as I was working on the script that he does not need... but then - like so many other thoughts in my head - it vanished.

I completed the script anyway and had intended to mention in my post that a PixelSearch takes up so much CPU power (if you are attempting to search a large area) that adding the overhead of a border may not work well for a "live" (existing) script. I was thinking along the lines of an adlib function that interrupts the PixelSearch* to paint a semi-transparent splash screen to indicate the PixelSearch area.

*Im not sure that an adlib function would interrupt a PixelSearch line and I did not want to code a test for that thought fleeting as it was. But you could have the splash screen appear and turn off right before each PixelSearch line as sort of a debug tool. You could also toggle this feature off and on via a hotkey... just in case you could not remember the area where you were searching.

I put this line in my post, "...or if I misunderstood your request" and I reread the original post knowing that I had something else to say, but I just gave up and went to bed.

Caveat: Im not a gamer and I dont know if the way the script writes the PixelSearch line of code for you is the best for gaming. Ive only used PixelSearch in 1 of my scripts and PixelChecksum in another. I wish that I had taken the time to write/use a tool like this for PixelChecksum when I was doing some OCR work. I needed to get really close to each character and exclude some changing info nearby.

My hope is that this script might be of some use to those scripting for apps like Firefox and the like when you might want to check a pixel on the tool bar to see if a page has finished loading.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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