;----以下为匹配左边第1区域,$1_x, $1_y, $1_w, $1_h分别为区域的xy坐标及宽高范围
For $i = 1 To 4
$result = _ImageSearchArea("图片" & $i & ".bmp", 1, $1_x, $1_y, $1_w, $1_h, $x1, $y1, 0)
If $result = 1 Then
MsgBox(0, 0, "匹配: 图片" & $i)
ExitLoop
EndIf
Next
;----以下为匹配左边第2区域,$2_x, $2_y, $2_w, $2_h分别为区域的xy坐标及宽高范围
For $i = 1 To 4
$result = _ImageSearchArea("图片" & $i & ".bmp", 1, $2_x, $2_y, $2_w, $2_h, $x1, $y1, 0)
If $result = 1 Then
MsgBox(0, 0, "匹配: 图片" & $i)
ExitLoop
EndIf
Next
;----
For ...
...
Next
;----以下为匹配左边第n区域
For $i = 1 To 4
$result = _ImageSearchArea("图片" & $i & ".bmp", 1, $n_x, $n_y, $n_w, $n_h, $x1, $y1, 0)
If $result = 1 Then
MsgBox(0, 0, "匹配: 图片" & $i)
ExitLoop
EndIf
Next |