Jump to content
Sign in to follow this  
Aceguy

Zoom it

Recommended Posts

Aceguy

#include<WindowsConstants.au3>
;zoomit


Opt("GUIOnEventMode", 1)

$x_s = 0
$ry = 0
$rowx = 200
Dim $row_x[$rowx + 1]


$Zi = GUICreate("Zoom", 400, 250, 320, 300, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$lbl = GUICtrlCreateLabel("", 250, 5, 75, 25)
$clr1 = GUICtrlCreateLabel("", 5, 125, 100, 50)
$got_clr=GUICtrlCreateLabel("",150,150,50,50)
GUICtrlSetBkColor(-1,0x000000)
$jmp_x = 0
$jmp_y = 0
For $x = 1 To $rowx
    $row_x[$x] = GUICtrlCreateLabel("", 2 + $x_s + $jmp_x, 2 + $ry + $jmp_y, 10, 10)
    GUICtrlSetBkColor($row_x[$x], 0xff0000)

    

    If IsInt($x / 20) Then
        $ry += 10
        $x_s = -10
    EndIf
    $x_s += 10
    
    If $x_s=100 Then
        $jmp_x = 1
    Else
        $jmp_x = 0
    EndIf

    If $ry=50 Then
        $jmp_y = 1
    Else
        $jmp_y = 0
    EndIf
Next

GUISetState(@SW_SHOW)

While 1
    $ms = MouseGetPos()
    GUICtrlSetData($lbl, "X " & $ms[0] & "  Y " & $ms[1])
    $py = 0
    $px = 0
    For $ms_x = 1 To $rowx

        GUICtrlSetBkColor($row_x[$ms_x], PixelGetColor($ms[0] + $px - 10, $ms[1] + $py - 5))
        If $px = 10 And $py = 4 Then 
        $pgc=PixelGetColor($ms[0] + $px - 10, $ms[1] + $py - 5)
        $hex=hex($pgc)
        $stlf=StringTrimLeft($hex,2)
        GUICtrlSetData($clr1, $pgc&"   0x"&$stlf)
        GUICtrlSetBkColor($got_clr,$pgc)
        EndIf
        
        If IsInt($ms_x / 20) Then
            $py += 1
            $px = -1
        EndIf

        $px += 1
    Next
    Sleep(25)
WEnd

that it, comments please.

Wonder if there is a way to stop the little flicker....

Edited by Aceguy

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.