Jump to content

Screenshooter


/dev/null
 Share

Recommended Posts

Hi guys,

inspired by the following thread Scan for an Image I created my first "larger" AutoIT script. It is not yet "perfect", but a

maybe good start.

In the thread mentioned above, jorgb told us about a tool called "Zephyr Test Runner", which is able to find a window by searching the whole screen for a picture. Part of this test utility is a tool, that helps to extract those pictures/icons from a screen shot.

So, my tool is a clone of that tool. It enables you to extract a selectable rectangle from the screen. This rectangle will be safed to a file and can later be used to find a window on the screen, based on that picture/rectangle.

HOWEVER, that code does not yet exist. I know there is something available from Larry, but I thought I'm going to implement this in the AutoIT source code, rather than in the scripting environment. Should be ways faster. Well, we will see if there is enough time to get this going :-))

BTW: The script needs the Screen Capture DLL (see the code).

BEWARE: If you select a large window, it will take awfully long to get the rectangle, as I had to use PixelGetColor. Using the Capture DLL was not an option, as I need the Pixels in an array and not as BMP or JPEG. However, for small icons it is fast enough.

EDIT: Uploaded Version 1.0.1. Will now also save the rectangle to the file partial_capture.bmp in the current working dir. I have not implemented a file selection for this, as this is just for testing purposes (to check if the rectangle was selected correctly)

Cheers

Kurt

screenshoter.au3

Edited by /dev/null

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Where do I get the DLL? When I run the autoit script I only see a grey area and I am asked to click on the screenshot..

Hi Jorgen,

it is Lazycats DLL, the URL is in my source code. Here is the link: http://proxru.port5.com/

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Hi Jorgen,

I just uploaded Version 1.0.1. Pls see EDIT section for changes.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

  • 2 months later...

Can anyone tell me where I can find the dll? the link provided is non-existent.

Thank you,

Luke

http://www.autoitscript.com/forum/index.ph...wtopic=8377&hl=

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Fantastic, thank you Kurt.

Now I just need to find out how to make the comparison.

I.e. I would like a script to run, take screenshots and save them (as rect files) then have another script run, make the same screenshots (and regions) as the ones the user made and then compare between them, report on the percentage of the same pixels...

Any other advices how this might be achieved?

Thank you,

luke

Link to comment
Share on other sites

Any other advices how this might be achieved?

Nope. I would also do it that way.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

How do I compare a region from currently captured screen to a saved region though?

byte by byte??

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Hello Everyone,

Larry made the find by rectangle thing oh, about 6 months ago. worked pretty good to. I don't remember what the link was but I used it to find x,y coords for images on a web site before we had COM support.

ah HA!! found it...

http://www.autoitscript.com/forum/index.ph...959entry44959

Mike

Edited by MikeOsdx
Link to comment
Share on other sites

  • 1 month later...

Just a quick thought,

I think this kind of "comparing screenshots" project would benefitt from using AI and fuzzy logic to do the comparing.

On example would be that you want to make you test on a machine with higher/lower screen resolution/ color depth than the one where the reference images was taken.

Unfortunately I do not have any sugestions on sutable libraries and samples.

Best wishes for the project. Regards

Uten

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...