Hi, i`m try use this library 2 days and now i have this function if some need. This works like Standart Pixel Search and have some more greate update by FF.
Func _PixelSearch($Left, $Top, $Right, $Bottom, $Colors, $ShadeVariation = 0, $Step = 1, $hWnd = -1, $PixelsCount = 1, $AreaSize = 1, $PosX = -1, $PosY = -1)
;calculate Real Pos and Size
Local $Temp
If $Left > $Right Then
$Temp = $Right
$Right = $Left
$Left = $Temp
$PosX = $Left
EndIf
If $Top > $Bottom Then
$Temp = $Bottom
$Bottom = $Top
$Top = $Temp
$PosY = $Bottom
EndIf
;check for Position
If $PosX = -1 Then $PosX = $Right ;Int(($Right - $Left) / 2)
If $PosY = -1 Then $PosY = $Top ;Int(($Bottom - $Top) / 2)
If $PosX < 0 Then $PosX = 0
If $PosY < 0 Then $PosY = 0
;check for Colors
If IsArray($Colors) Then
FFResetColors()
For $i = 0 To UBound($Colors) -1
FFAddColor($Colors[$i])
Next
$Colors = -1
EndIf
If $Left = 0 Then $Left = 1
If $Top = 0 Then $Top = 1
;FFNearestSpot($SizeSearch, $NbPixel, $PosX, $PosY, $Color, $ShadeVariation=0, $ForceNewSnap=true, $Left=0, $Top=0, $Right=0, $Bottom=0, $NoSnapShot=$FFLastSnap, $WindowHandle=-1)
If $hWnd = -1 Then
;FFAddExcludedArea()
Local $result = FFNearestSpot($PixelsCount, $AreaSize, $PosX, $PosY, $Colors, $ShadeVariation, False, 0, 0, $Left + $Right, $Top + $Bottom, False,0)
;Local $result = DllCall($FFDllHandle, "int", "GenericColorSearch", "int", $PixelsCount, "int*", $AreaSize, "int*", $PosX, "int*",$PosY, "int", $Colors, "int", $ShadeVariation, "int", $FFLastSnap)
Else
;FFAddExcludedArea($Left, $Top, $Right, $Bottom)
Local $result = FFNearestSpot($PixelsCount, $AreaSize, $PosX, $PosY, $Colors, $ShadeVariation, False, $Left, $Top, $Right, $Bottom, False, $hWnd)
;Local $result = DllCall($FFDllHandle, "int", "GenericColorSearch", "int", $PixelsCount, "int*", $AreaSize, "int*", $PosX, "int*",$PosY, "int", $Colors, "int", $ShadeVariation, "int", $FFLastSnap)
;FFResetExcludedAreas()
EndIf
;check for errors
If Not IsArray($result) Then
SetError(1)
Return False
Else
Return $result
EndIf
But, u need write before use somthing this^
$aWinPos = WinGetPos("")
$aWinSize = WinGetClientSize("")
$hWnd = WinGetHandle("")
$rEndX = $aWinSize[0]
$rEndY = $aWinSize[1]
FFSnapShot(0, 0, $rEndX, $rEndY, $FFDefaultSnapShot, $hWnd)
;and now u can use this function for this FFSnapShot
Local $Colors = [0xECECEC,0xCBCBCB]
_PixelSearch($rEndX - 10, $rEndY - 10, $rEndX - 160, $rEndY - 160, $Colors, 5, 1, $hWnd, 1, 2)
;or
_PixelSearch($rEndX - 10, $rEndY - 10, $rEndX - 160, $rEndY - 160, 0xCBCBCB, 5, 1, $hWnd, 1, 2)
Who can help me for update this fuction for dllcall use and maybe crop SnapShot fist (i try ;FFAddExcludedArea($Left, $Top, $Right, $Bottom))
P.S.Strongly not kick me for my eng - I'm from Ukraine