junkew Posted June 12, 2010 Share Posted June 12, 2010 Get the calculator example to work Then you work out how it works on what you want to recognize Partial matching can be changed in the code to whatever you like. Now its in steps of 10% or change $iFuzzyDist = 1 to something else You should be able to work out a working example based on the dumphex My intention was never to write this function to recognize cards and faces. You have to work out other logic and definitely you can reuse logic from my source but I am sure you need a different algorithm to recognize all cards in a reasonable speed.1. For getting the calculator example to work don't check the BACKSPACE as on some systems its lowercase to recognizeReplace this Global $BitmapFileNamesCalculator[6] = ["BACKSPACE.bmp", "0.bmp","1.bmp","2.bmp","3.bmp","4.bmp"]withGlobal $BitmapFileNamesCalculator[6] = ["0.bmp","1.bmp","2.bmp","3.bmp","4.bmp"]Comment out this;Capture an area within the calculator area backspace $tBeginTime = TimerInit() $pos = ControlGetPos("", "", "[CLASS:Button; TEXT:BACKSPACE]") $aWinPos = WinGetPos($calcHWND) $aWinCSize = WinGetClientSize($calcHWND) ;Q&D calculation of offsets to capture _ScreenCapture_Capture($Bitmap3Filename, ($aWinPos[0] + $pos[0]) + ($aWinPos[2] - $aWinCSize[0]) - 3, ($aWinPos[1] + $pos[1]) + ($aWinPos[3] - $aWinCSize[1]) - 3, $aWinPos[0] + $pos[0] + $pos[2] + 3, ($aWinPos[1] + $pos[1]) + ($aWinPos[3] - $aWinCSize[1]) + $pos[3] - 3, False) ConsoleWrite("Saving backspacebutton " & TimerDiff($tBeginTime) & " milliseconds " & @LF) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets 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