As i have this snapshoot of an excel file in this link-
https://drive.google.com/open?id=0B5y9r ... authuser=0
here i want to click first on view tab (first red box in the image) and then click on full screen button (second red box in the image). but i want that when the file is already in full screen mode then it should not click any where. the mouse coordinates for view tab (first red box in the image) are 458, 34, 505, 45 and for full screen button (second red box in the image) are 204, 59, 243 ,120 and the path of the screenshoot (image file) is C:\Users\Manoj Aggarwal\Desktop\test.png. So how can i use imagesearch command for that. I have researched on this command on autohotkey forum too much and on other sites also, but nothing is providing me the correct way to use this command.
Kindly tell me whether i have to set entire screenshoot, as shown in the link, as image file path or only to crop the red circled button and then set them as image file path? please tell me everything in detail. Hoping for a good help from you. A very thanks to you.[url][/url]
How to use imagesearch command in the following scenario? Topic is solved
- Almost_there
- Posts: 404
- Joined: 30 Sep 2014, 10:32
Re: How to use imagesearch command in the following scenario
Hi.
I don't fully understand what you're trying to do within Excel fro what you try to explain. However I can give you an idea on how to use ImageSearch.
Say you want to detect wheter a specific button is visible (able to click on it).
I beleive you want to detect if Full screen is active. Then you can do the following:
My first mistake when I first tried to use the ImageSearch command was that I thaught that increasing Y coordinates was upward on the screen, but the Y-axis is reversed. Very important.
So when defining the corners of search area (upper left and lower right) make sure that X2>X1 and Y2>Y1. If those conditions aren't trye the command gives errorlevel 2.
I don't fully understand what you're trying to do within Excel fro what you try to explain. However I can give you an idea on how to use ImageSearch.
Say you want to detect wheter a specific button is visible (able to click on it).
I beleive you want to detect if Full screen is active. Then you can do the following:
- Take a screenshot of Excel window.
- Paste image of screenshot into an image editor (MS paint works, but peronally I prefer Irfanview)
- Crop the image so only the button is left. Make sure some of the orange background color belonging to the button is within the cropped image. The cropped image should be as small as possible.
- Save the cropped image file of the activated version of "Full screen" button. I would have choosen a reasonable file name, eg. "ExcelButtonFullscreenActivated.bmp".
My first mistake when I first tried to use the ImageSearch command was that I thaught that increasing Y coordinates was upward on the screen, but the Y-axis is reversed. Very important.
So when defining the corners of search area (upper left and lower right) make sure that X2>X1 and Y2>Y1. If those conditions aren't trye the command gives errorlevel 2.
Re: How to use imagesearch command in the following scenario
Thanks Almost_there for your great reply..
one more thing i with to know is that-
what is the difference between using simple imagesearch command and using it with coordmode... What deference does it really make when we use it with coodmode.. please elaborate and provide few examples also..
Thanks....
one more thing i with to know is that-
what is the difference between using simple imagesearch command and using it with coordmode... What deference does it really make when we use it with coodmode.. please elaborate and provide few examples also..
Thanks....
Re: How to use imagesearch command in the following scenario Topic is solved
If you use ImageSearch without using CoordMode to change the default, the coordinates used for the search area and for location of the found image are relative to the upper left corner of the active window. It's probably easiest for you to use it in this manner.
You could use CoordMode to have the search area and found location be based on the overall screen coordinates or the client portion of the window. For example, if the image you are searching for is not confined to any one particular window, you may want to search the whole screen for it. Then you can find it no matter what window it appears in.
Any of these methods will work fine as long as you understand which mode you are in and are consistent in how you handle the search area and found location coordinates.
You could use CoordMode to have the search area and found location be based on the overall screen coordinates or the client portion of the window. For example, if the image you are searching for is not confined to any one particular window, you may want to search the whole screen for it. Then you can find it no matter what window it appears in.
Any of these methods will work fine as long as you understand which mode you are in and are consistent in how you handle the search area and found location coordinates.
Re: How to use imagesearch command in the following scenario
This thread really should be in the "Ask For Help" forum, by the way. The "Scripts and Functions" forum is for sharing finished scripts and functions that others may find useful.
Re: How to use imagesearch command in the following scenario
--topic moved to "Ask for help"--
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Who is online
Users browsing this forum: marypoppins_1, OrangeCat, RussF and 132 guests