Jump to content

Can anyone get this to work?


Recommended Posts

  • 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 recognize

Replace this

Global $BitmapFileNamesCalculator[6] = ["BACKSPACE.bmp", "0.bmp","1.bmp","2.bmp","3.bmp","4.bmp"]

with

Global $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)
Link to comment
Share on other sites

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...