e.g GIF $resultPosition - Set where the returned x,y location of the image is. Needed when colors of image differ from desktop. 1 for centre of image, 0 for top left of image $x $y - Return the x and y location of the image Return Value(s): On Success - Returns 1 On Failure - Returns 0 = Func _WaitForImageSearch ( $findImage, $waitSecs, $resultPosition, ByRef $x, ByRef $y, $tolerance ) $waitSecs = $waitSecs * 1000 $startTime = TimerInit ( ) While TimerDiff ( $startTime ) 0 Then return 1 EndIf WEnd return 0 EndFunc = Description: Wait for a specified number of seconds for any of a set of images to appear Syntax: _WaitForImagesSearch Parameter(s): $waitSecs - seconds to try and find the image $findImage - the ARRAY of images to locate on the desktop - ARRAY is set to the number of images to loop through ARRAY is the first image $tolerance - 0 for no tolerance (0-255). 1 for centre of image, 0 for top left of image $x $y - Return the x and y location of the image Return Value(s): On Success - Returns 1 On Failure - Returns 0 Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify a desktop region to search = Func _ImageSearch ( $findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance ) return _ImageSearchArea ( $findImage, $resultPosition, 0, 0, ,, $x, $y, $tolerance ) EndFunc Func _ImageSearchArea ( $findImage, $resultPosition, $x1, $y1, $right, $bottom, ByRef $x, ByRef $y, $tolerance ) MsgBox(0,"asd","" & $x1 & " " & $y1 & " " & $right & " " & $bottom) if $tolerance > 0 then $findImage = "*" & $tolerance & " " & $findImage $result = DllCall ( "ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage ) If error exit if $result = "0" then return 0 Otherwise get the x,y location of the match and the size of the image to compute the centre of search $array = StringSplit ( $result, "|" ) $x = Int ( Number ( $array ) ) $y = Int ( Number ( $array ) ) if $resultPosition = 1 then $x = $x + Int ( Number ( $array ) / 2 ) $y = $y + Int ( Number ( $array ) / 2 ) endif return 1 EndFunc = Description: Wait for a specified number of seconds for an image to appear Syntax: _WaitForImageSearch, _WaitForImagesSearch Parameter(s): $waitSecs - seconds to try and find the image $findImage - the image to locate on the desktop $tolerance - 0 for no tolerance (0-255). e.g GIF $resultPosition - Set where the returned x,y location of the image is. I was tapping on the keyboard and unwittingly activated some coordinates on the BlueStacks, they show the X-point and the Y-point, where the mouse is positioned, and it disturbs me to read some things. Expand collapse popup #include-once - AutoIt Version: 3.0 Language: English Description: Functions that assist with Image Search Require that the ImageSearchDLL.dll be loadable - = Description: Find the position of an image on the desktop Syntax: _ImageSearchArea, _ImageSearch Parameter(s): $findImage - the image to locate on the desktop $tolerance - 0 for no tolerance (0-255).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |