Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' Gambas class file
- Public zoom As Integer = -5
- Public Sub _new()
- End
- Public Sub Form_Open()
- settings.Read(Me)
- Me.Title = "Lupita Zoom " & Str$(zoom + 5)
- Timer1.Start()
- End
- Public Sub Timer1_Timer()
- Dim coordenadas As String
- Dim mousex As Integer
- Dim mousey As Integer
- 'leo posicion del raton
- 'leer posicion del raton
- coordenadas = funciones.ejecutar_comando("xdotool getmouselocation")
- 'posicion:
- Try mousex = Val(funciones.xmouse(coordenadas))
- Try mousey = Val(funciones.ymouse(coordenadas))
- If Error Then Return
- If (mousex - Me.w / (10 + zoom)) < 0 Then
- mousex = Me.w / (10 + zoom)
- Endif
- If (mousey - Me.h / (10 + zoom)) < 0 Then
- mousey = Me.h / (10 + zoom)
- Endif
- If (mousex + (Me.w / (10 + zoom) * 2) / 2) > Screen.W Then
- mousex = Screen.w - (Me.w / (10 + zoom) * 2) / 2
- Endif
- If (mousey + (Me.h / (10 + zoom) * 2) / 2) > Screen.h Then
- mousey = Screen.h - (Me.h / (10 + zoom) * 2) / 2
- Endif
- PictureBoxLupa.Picture = Desktop.Screenshot(mousex - Me.w / (10 + zoom), mousey - Me.h / (10 + zoom), Me.w / (10 + zoom) * 2, Me.h / (10 + zoom) * 2)
- End
- Public Sub Form_Resize()
- PictureBoxLupa.w = Me.W
- PictureBoxLupa.h = Me.h
- End
- Public Sub PictureBoxLupa_MouseWheel()
- Debug Mouse.Delta
- zoom += Mouse.Delta
- If zoom <= -5 Then zoom = -5
- Me.Title = "Lupita Zoom " & Str$(zoom + 5)
- End
- Public Sub Form_Close()
- settings.write(Me)
- End
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement