How to change the size of window at run time ?

I am facing a problem with finding out the images in window . Here is the scenario. Please see the attached screen shot how the window appears

in that window i had captured one image , when i re sized the window the earlier captures image is failing to identify.

when i launched the application the window may appear in any form which has shown in the scrren shot and it is customizable window.


1.Can you tell me how can i resize the window to my desired size when ones the application is launched when it is done i think i can captures the images
2. Can you tell me how to get the co-ordinates any any image in the window . I have imagelocation and imagehotspot functions to get the coordinated but when the window is resized to any size it is failing.

Please provide me code snippets for both the scenarios.its very urgent to me .

Comments

  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    It looks like the background color of this window has a fairly strong gradient, so it can vary from a fairly light blue to rather dark. I'm guessing that is the reason that your image didn't match when the window was a different shape.

    There are several ways you might solve the problem. The first would be to capture a smaller image of the icon you need, avoiding capturing the background color. I think that approach would work well for some of the icons, but others are quite small which might make this difficult.

    You could also try increasing the tolerance of the image to see if that will enable it to be found on any background color. Use the Image Doctor for this. The danger of course is that once you increase the tolerance enough for the icon to be found, you may also start getting false matches in other places. The Image Doctor will increase the tolerance in steps of 5 until the image is found, and report how many places on the screen it was found. You can do fine adjustments manually to see if there is an optimal tolerance level that will work.

    Or simply capture multiple images of each icon. Probably one image on the lightest color and one on the darkest color would be enough.

    If none of those approaches works, you could capture an image and then edit it in an external tool to set the background pixels to be clear. Then eggPlant will ignore those pixels and the background color will no longer be a problem.

    The other possibility would be to have your script set the window to be the same size each time the script is run. To do this you would script the same actions that a person would take to resize the window, whether that involves dragging a corner of the window to a new location or whatever. One good approach is to first drag the top left corner of the window to a fixed location on the screen, and then drag the lower right corner to a corresponding known location.

    Hopefully one of those approaches will work for you.
Sign In or Register to comment.