Oreo9 Posted August 15, 2006 Share Posted August 15, 2006 I would like to first thank everyone who had read this topic, and I will be grateful for any reply. What I am trying to do: #A ) Using picture buttons (GUI) to select an image (picture file) to compare with an area screen (pixels.) #B ) If the screen pixel does not match exactly as the picture on the button, then run AutoIt script (i.e. left-click the mouse once at a specific [x,y] location) until it does. I have finished the script of part #B already, it is simple enough for me to write the logic part but I am not sure if part #A is possible to do because I have to: #1 ) make picture buttons #2 ) compare pictures with screen display Problem #1 - Using Visual Studio .Net (VS.Net) can create GUI button (script selection) program but VS.Net does not execute AutoIt scripts.... - It is easy to run AutoIt scripts to emulate the use of mouse/keyboard but I cannot use it to create a GUI button program..... especially I would like to use picture instead of text for the buttons.... Problem #2 Using AutoIt, I can take a pixel from screen to see if it matches a specific color. So theoretically, if I run a set of loops then AutoIt can compare the pixel color of the (selected) picture with the screen display. So, if color of all picture pixels match the display pixels then we have a match; else, if one pixel found not match then (they are not a match pixel set at all and) we can stop the loop. - However, I am not sure if AutoIt works the same way for reading display pixel (color) the same as reading picture pixels (that I saved the file locally in my computer.) - Even if I can create this loop, it will be really slow. Is there a better way to improve it? If you have any idea, could you please show me the link(s) of some script examples / similar topics? Thank you for all your help Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 15, 2006 Moderators Share Posted August 15, 2006 I am going assume you are making a "small button" no where in comparison to the actual size of the Picture it belates to.To make a pictured button, you'll need to use GUICtrlCreatePic() with a variable to define it's control ID, this way you can treat that Pic as a button.To match said picture in another application, since there's no sure fire (quick) method of getting that pictures value from the file itself you'll need to make sure you have done a PixelCheckSum() (a UDF in the Help File) on each picture ahead of time, then compare the CheckSum on the screen to that pictures checksumIf VB can use DLL calls then you can use the AutoItX.Dll to use AutoIt functions from it.If you need help on a "certain" part of your script, post it (a working example)... this is going to be the only way to get true help, because we will be chasing eachothers tails otherwise. 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. Link to comment Share on other sites More sharing options...
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