Sign in to follow this  
Followers 0
Romm

PixelSearch BUT button-to-top

2 posts in this topic

Remarks

The search is performed left-to-right, top-to-bottom and the first match is returned.

Is it posible to make bottop-to-top search?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <GUIConstantsEx.au3>

Opt("GUIOnEventMode", 1)
Opt("PixelCoordMode", 2)

$GUI = GUICreate("Bottom to Top", 200, 200, -1, -1)
GUISetBkColor(0x000000, $GUI)
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$lab = GUICtrlCreateLabel("", 0, 100, 1, 1)
GUICtrlSetBkColor(-1, 0xffffff)
$lab2 = GUICtrlCreateLabel("", 55, 55, 1, 1)
GUICtrlSetBkColor(-1, 0xff0000)
$_Pixel_Get = GUICtrlCreateButton("Pixel Get", 0, 0, 100, 20)
GUICtrlSetOnEvent(-1, "_Pixel_Get")
GUISetState(@SW_SHOW)

While 1
    Sleep(10)
WEnd

Func _Pixel_Get()
    $x = 0
    $y = 100
    Do
        If $x = 101 Then
            $x = 0
            $y -= 1
        EndIf
        $pix = PixelGetColor($x, $y)
        ControlMove($GUI, "", $lab, $x, $y) ;<<<<<<<<<<<<<<<<<<<< this just shows the search from bottom to top
        If Hex($pix, 6) = "FF0000"  Then
            MsgBox(262144, "test", $x & " - " & $y & " - " & Hex($pix, 6))
            ExitLoop
        EndIf
        $x += 1
    Until $y = 50
EndFunc   ;==>_Pixel_Get

Func _Exit()
    Exit
EndFunc   ;==>_ExitoÝ÷ Úö««b¢v®¶­sb6æ6ÇVFRfÇC´uT6öç7FçG4WæS2fwC° ¤÷BgV÷C´uTöäWfVçDÖöFRgV÷C²Â¤÷BgV÷CµVÄ6ö÷&DÖöFRgV÷C²Â" ¢b33c´uTÒuT7&VFRgV÷C´&÷GFöÒFòF÷gV÷C²Â#Â#ÂÓÂÓ¤uT6WD&´6öÆ÷"Âb33c´uT¤uT6WDöäWfVçBb33c´uTôUdTåEô4Äõ4RÂgV÷CµôWBgV÷C²¢b33c¶Æ"ÒuT7G&Ä7&VFTÆ&VÂgV÷C²gV÷C²Â¤uT7G&Å6WD&´6öÆ÷"ÓÂfffffb¢b33c¶Æ#"ÒuT7G&Ä7&VFTÆ&VÂgV÷C²gV÷C²ÂSRÂSR¤uT7G&Å6WD&´6öÆ÷"ÓÂfc¢b33cµõVÅôvWBÒuT7G&Ä7&VFT'WGFöâgV÷CµVÂvWBgV÷C²ÂÂÂÂ#¤uT7G&Å6WDöäWfVçBÓÂgV÷Cµõô&÷C%F÷gV÷C²¤uT6WE7FFR5uõ4õr ¥vÆR¢6ÆVW¥tVæ@ ¤gVæ2õô&÷C%F÷ õVÅôvWBÂSÂÂÂgV÷C´dcgV÷C²¤VæDgVæ0 ¤gVæ2õVÅôvWBb33c¶ÆVgBÂb33c·F÷Âb33c·&vBÂb33c¶&÷GFöÒÂb33c¶6öÆ÷"¢b33c·Òb33c¶ÆVg@¢b33c·Òb33c¶&÷GFöТFð¢bb33c·Òb33c·&vB³FVà¢b33c·Ò¢b33c·ÓÒ¢VæD`¢b33c·ÒVÄvWD6öÆ÷"b33c·Âb33c·¢6öçG&öÄÖ÷fRb33c´uTÂgV÷C²gV÷C²Âb33c¶Æ"Âb33c·Âb33c·²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²fÇC²F2§W7B6÷w2FR6V&6g&öÒ&÷GFöÒFòF÷¢bWb33c·ÂbÒb33c¶6öÆ÷"FVà¢×6t&÷#c#CBÂgV÷C·FW7BgV÷C²ÂgV÷C·ÒgV÷C²fײb33c·fײgV÷C²ÂgV÷C²fײgV÷C·ÒgV÷C²fײb33c·fײgV÷C²ÂgV÷C²fײWb33c·Âb¢WDÆö÷¢VæD`¢b33c·³Ò¢VçFÂb33c·Òb33c·F÷¤VæDgVæ2³ÓÒfwCµõVÅôvW@ ¤gVæ2ôWB¢W@¤VæDgVæ2³ÓÒfwCµôW@

Edited by The Ape

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0