Jump to content

Recommended Posts

Posted

Hello, I have a problem, and I still can't find how to do the following, is to look for an example image of the autoit icon within another image, it could be the image of a desktop screenshot but sending the image myself, but I can't find anything that I can help with this, I already tried the libraries: 'ImageSearch.au3', '_ImageSearch_UDF.au3', 'HandleImgSearch.au3', but none of these do this, they always do it with the desktop screenshot without being able to select which image in specific.

 

I also found this but in the same way it does not work for me, I run it normally and it always returns the same, this or not the image of the calculator on the screen.

I appreciate if you can help me with this.

Posted

I check it but it does not work until the call of this function:

;Find first pixel that is diffrent than ....the first pixel
Func _FindFirstDiff($tPix)

    ;####### (BinaryStrLen = 106) ########################################################################################################################
    Static Local $Opcode = '0xC80000008B5D0C8B1383C3048B4D103913750C83C304E2F7B800000000EB118B5508FF338F028B451029C883C002EB00C9C20C00'
    Static Local $aMemBuff = DllCall("kernel32.dll", "ptr", "VirtualAlloc", "ptr", 0, "ulong_ptr", BinaryLen($Opcode), "dword", 4096, "dword", 64)
    Static Local $tMem = DllStructCreate('byte[' & BinaryLen($Opcode) & ']', $aMemBuff[0])
    Static Local $fSet = DllStructSetData($tMem, 1, $Opcode)
    ;#####################################################################################################################################################

    Local $iMaxLoops = (DllStructGetSize($tPix) / 4) - 1
    Local $aRet = DllCallAddress('dword', DllStructGetPtr($tMem), 'dword*', 0, 'struct*', $tPix, 'dword', $iMaxLoops);On this exact line

    Return $aRet

EndFunc   ;==>_FindFirstDiff

And then it throws me this error:

!>12:21:20 AutoIt3.exe ended.rc:-1073741819

It seems that it stays in an infinite loop or an infinite function call, and the program closes, I am using exactly the same example code that is in the documentation.

Posted

It is quite simple in fact.  You just need to create two 2D arrays and search for one array being part of the second array.  See _GDIPlus_BitmapLockBits to understand how to create an array from any image source.  Of course it will depend how fast you need to achieve this...

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
  • Recently Browsing   0 members

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