Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
ZoomScreen - frmZoomScreen.frm

frmZoomScreen.frm

Caricato da: Antometal
Scarica il programma completo

  1. Option Explicit
  2.  
  3. Private Sub Ridimensiona(Larghezza As Integer, Altezza As Integer)
  4. Dim ProporzioneAL As Double
  5.     If laghezza < 6000 Or Altezza < 4650 Then
  6.         Larghezza = 6000
  7.         Altezza = 4650
  8.     End If
  9. ProporzioneAL = Altezza / Larghezza
  10.  
  11.  
  12. End Sub
  13.  
  14. Private Sub chkMouse_Click()
  15. imgMouse.Visible = CBool(chkMouse.Value)
  16. End Sub
  17.  
  18. Private Sub cmdPausaRiprendi_Click()
  19. tmrPrelievo.Enabled = Not tmrPrelievo.Enabled
  20.     If tmrPrelievo.Enabled = False Then
  21.         cmdPausaRiprendi.Caption = "Riprendi"
  22.         picScreen.AutoRedraw = True
  23.     Else
  24.         cmdPausaRiprendi.Caption = "Pausa"
  25.         picScreen.AutoRedraw = False
  26.     End If
  27. End Sub
  28.  
  29. Private Sub Form_Load()
  30. DC = GetDC(0)
  31. End Sub
  32.  
  33. Private Sub Form_Unload(Cancel As Integer)
  34. ReleaseDC 0, DC
  35. End Sub
  36.  
  37. Private Sub cmdSalva_Click()
  38. picScreen.AutoRedraw = True
  39. tmrPrelievo.Enabled = False
  40.     If cmdPausaRiprendi.Caption = "Riprendi" Then
  41.         CDialog.ShowSave
  42.             If CDialog.CancelError = False Then SavePicture picScreen.Image, CDialog.FileName
  43.         Exit Sub
  44.     End If
  45. Prelievo
  46. CDialog.ShowSave
  47.     If CDialog.CancelError = False Then SavePicture picScreen.Image, CDialog.FileName
  48. tmrPrelievo.Enabled = True
  49. picScreen.AutoRedraw = False
  50. End Sub
  51.  
  52. Private Sub sldInterval_Scroll()
  53. txtInterval = sldInterval.Value
  54. End Sub
  55.  
  56. Private Sub sldZoom_KeyPress(KeyAscii As Integer)
  57.     If KeyAscii = Asc("+") Then sldZoom.Value = sldZoom.Value + 1
  58.     If KeyAscii = Asc("-") Then sldZoom.Value = sldZoom.Value - 1
  59. txtZoom.Text = sldZoom.Value
  60. End Sub
  61.  
  62. Private Sub sldZoom_Scroll()
  63. txtZoom = sldZoom.Value
  64. End Sub
  65.  
  66. Private Sub Prelievo()
  67. Dim Mouse As Pointapi
  68. Dim Dimensione As Pointapi
  69. GetCursorPos Mouse
  70. Dimensione.x = picScreen.ScaleWidth / sldZoom.Value * 100
  71. Dimensione.y = picScreen.ScaleHeight / sldZoom.Value * 100
  72.     If chkRefresh.Value = vbChecked Then picScreen.Refresh
  73.     If chkinvertito.Value = vbChecked Then
  74.         StretchBlt picScreen.hdc, 0, 0, picScreen.ScaleWidth, picScreen.ScaleHeight, DC, Mouse.x - Dimensione.x / 2, Mouse.y - Dimensione.y / 2, Dimensione.x, Dimensione.y, vbNotSrcCopy
  75.     Else
  76.         StretchBlt picScreen.hdc, 0, 0, picScreen.ScaleWidth, picScreen.ScaleHeight, DC, Mouse.x - Dimensione.x / 2, Mouse.y - Dimensione.y / 2, Dimensione.x, Dimensione.y, vbSrcCopy
  77.     End If
  78.     'If imgMouse.Visible = True Then picScreen.PaintPicture imgMouse.Picture, Dimensione.x / 2, Dimensione.y / 2
  79. stbDettagli.Panels(1).Text = "Coordina X del mouse: " & Mouse.x
  80. stbDettagli.Panels(2).Text = "Coordina Y del mouse: " & Mouse.y
  81. End Sub
  82.  
  83. Private Sub tmrPrelievo_Timer()
  84. Prelievo
  85. End Sub
  86.  
  87. Private Sub txtInterval_Change()
  88. txtInterval = Val(txtInterval)
  89. sldInterval.Value = txtInterval
  90. tmrPrelievo.Interval = txtInterval
  91. End Sub
  92.  
  93. Private Sub txtInterval_GotFocus()
  94. txtInterval.SelStart = 0
  95. txtInterval.SelLength = Len(txtInterval)
  96. End Sub
  97.  
  98. Private Sub txtZoom_Change()
  99. sldZoom.Value = Val(txtZoom)
  100. txtZoom = Val(txtZoom)
  101. End Sub
  102.  
  103. Private Sub txtZoom_GotFocus()
  104. txtZoom.SelStart = 0
  105. txtZoom.SelLength = Len(txtZoom)
  106. End Sub