Behroz Posted March 24, 2011 Posted March 24, 2011 Hello All, I am new to autoit and i have a small task to do. I have an image and by the image i have to get the state of the software like idle or busy. When the software is busy a symbol is shown on the bottom of the image. I want to compare that symbol with the image and if i exists then the function should return 1 else 0. Here is the symbol: http://img829.imageshack.us/i/crop2e.png/ Here is the screen in which i have to search the symbol: http://img340.imageshack.us/i/busy1800x600.png/ Kindly, help me. Code samples would be great. Regards Behroz Sikander
kkmusclenerd Posted March 24, 2011 Posted March 24, 2011 Hello All,I am new to autoit and i have a small task to do. I have an image and by the image i have to get the state of the software like idle or busy. When the software is busy a symbol is shown on the bottom of the image. I want to compare that symbol with the image and if i exists then the function should return 1 else 0.Here is the symbol:http://img829.imageshack.us/i/crop2e.png/Here is the screen in which i have to search the symbol:http://img340.imageshack.us/i/busy1800x600.png/Kindly, help me. Code samples would be great.RegardsBehroz SikanderHi there I'm a newbi so don't be mad if im way off base, it's probably a ghetto way to do it but... what about PixelGetColor. maybe put it in a loop that polls every second?
Tvern Posted March 24, 2011 Posted March 24, 2011 (edited) Edit: The post below probably makes more sense. I am going to assume that the au3 window info tool will not be of much use on that window, but it is still worth it to check if any controls, or values are recognised in that window. It might make things a lot easier and more reliable. A few things that could be of importance: Is the image always in the exact same position, or can it more left, or right depending on other items in the statusbar? Is the location you expect the icon to appear black when the icon is not vissible, or could there be other icons/colors present? Is the icon animated? If the icon is always in the same location, there are no other icons using that location, and the icon is not animated, you'll be able to simply check a pixel relative to the bottom left corner of the screen for color. If a number of icons are possible in that location you should still be able to do so, but you have to check if none of the other icons return a false positive. If the icon can appear anywhere on the statusbar you might have to use PixelChecksum() relative to the bottom of the window, moving from the leftmost position where the icon can appear, to the rightmost. If the icon is animated you may have a very hard time doing this by "visual" comparison. Functions that might be usefull for the above options are: WinGetPos() ;To find the location and size of the window, from which you can calculate where the icon should appear. PixelGetColor() or PixelCheckSum() to check if the icon is present. There might be a better way of doing it, but it's hard to say without being able to test the program myself. Edited March 24, 2011 by Tvern
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now