We really tried everything to get the 100% exact same Pixel colors on every device. But it seems to be not possible, unless every device uses the same gpu. Tried to install fresh Windows 10 to 3 devices. 2 of them got the same graphics card, where Pixel colors were exact the same. But the third one had a different graphics card and different Pixel colors as well.
All of them used the same monitor, so i think there is no way around handling pixel variations...
The pictures it uses are about 539 x 329, which luckily isn't too big.
Do you think it would be possible to add some kind of pixel variation "detection" to _GetScreen_SearchArea without loosing too much performance?
As for _GetScreen_GetPixel($iX, $iY), i simply use the returned color with the following function:
;Returns 1 if pixel is within the set shade variance, 0 if it is not.
;$RBG = the color you are looking for
;$pixel = the actual color of the pixel
;$shade the ammount of variance allowed. I think its 0-255.
Func CheckColorVariation($RBG, $pixel, $shade = 0)
$difference = 0
$mask = BitAND($RBG, 0xff0000)
$mask = BitShift($mask, 16)
$pix = BitAND($pixel, 0xff0000)
$pix = BitShift($pix, 16)
$difference = abs($mask-$pix)
If $difference > $shade Then
Return 0
EndIf
$mask = BitAND($RBG, 0x00ff00)
$mask = BitShift($mask, 8)
$pix = BitAND($pixel, 0x00ff00)
$pix = BitShift($pix, 8)
$difference = abs($mask-$pix)
If $difference > $shade Then
Return 0
EndIf
$mask = BitAND($RBG, 0x0000ff)
$pix = BitAND($pixel, 0x0000ff)
$difference = abs($mask-$pix)
If $difference > $shade Then
Return 0
EndIf
Return 1
EndFunc
It works great, however i have no idea how to properly implement this function into _GetScreen_SearchArea since it returnes coordinates instead of colors.
Any idea? 😕