Skip to content

Commit

Permalink
New MCode and other features for Gdip_ImageSearch
Browse files Browse the repository at this point in the history
PixelAverage and the search directions for the needle have been removed.
The 4 basic search directions work now for the haystack instead, and the
2 ImageSearch MCodes were unified into a single one. For the next
update, I intend to implement 4 more search directions and fix the Trans
problem, as it's currently working with characters instead of numeric
color values.
  • Loading branch information
Antonio committed Mar 23, 2013
1 parent 53e2a30 commit cd7fa91
Show file tree
Hide file tree
Showing 12 changed files with 309 additions and 482 deletions.
325 changes: 176 additions & 149 deletions Functions/Gdip_ImageSearch/Gdip_ImageSearch.ahk

Large diffs are not rendered by default.

450 changes: 124 additions & 326 deletions Functions/Gdip_ImageSearch/Gdip_ImageSearch.c

Large diffs are not rendered by default.

File renamed without changes
File renamed without changes
Binary file added Functions/Gdip_ImageSearch/T_001_folder02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added Functions/Gdip_ImageSearch/T_002_haystack-novo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Functions/Gdip_ImageSearch/T_002_needle-novo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Functions/Gdip_ImageSearch/T_002_needle-novo02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Functions/Gdip_ImageSearch/T_003_big.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Functions/Gdip_ImageSearch/T_003_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions Functions/Gdip_ImageSearch/TestScript.ahk
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
;************************************************
; Test script for Gdip_ImageSearch()
; by MasterFocus
; 09/March/2013 09:15 BRT
; 23/March/2013 02:00 BRT
;************************************************

#NoEnv
ListLines, Off
;ListLines, Off
SetBatchLines, -1
Process, Priority,, High

Expand All @@ -15,15 +15,17 @@ Process, Priority,, High
OnExit, EXIT_LABEL

gdipToken := Gdip_Startup()

;;SLEEP, 2000
;;bmpHaystack := Gdip_BitmapFromScreen()
bmpHaystack := Gdip_CreateBitmapFromFile("haystack.png")
bmpNeedle := Gdip_CreateBitmapFromFile("folder.png")
ERR := Gdip_ImageSearch(bmpHaystack,bmpNeedle,LIST,COUNT)

bmpHaystack := Gdip_CreateBitmapFromFile("T_002_haystack-novo.png")
bmpNeedle := Gdip_CreateBitmapFromFile("T_002_needle-novo.png")
RET := Gdip_ImageSearch(bmpHaystack,bmpNeedle,LIST,COUNT,0,0,0,0,0,"ÿÿÿ",1,0)
Gdip_DisposeImage(bmpHaystack)
Gdip_DisposeImage(bmpNeedle)
Gdip_Shutdown(gdipToken)

MsgBox, % "Error: " ERR "`tCount: " COUNT "`n`n" LIST
MsgBox, % "Returned: " RET "`tCount: " COUNT "`n`n" LIST

;; following loop used for pointing to each instance of
;; the needle when the haystack is the screen
Expand Down

0 comments on commit cd7fa91

Please sign in to comment.