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 2.0 - frmZoomScreen.frm

frmZoomScreen.frm

Caricato da: Antometal
Scarica il programma completo

  1. Option Explicit
  2.  
  3. Private Sub chkStop_Click()
  4. tmrPrelievo.Enabled = Not CBool(chkStop.Value)
  5. End Sub
  6.  
  7. Private Sub Form_Load()
  8. DC = GetDC(0)
  9. frmZoomScreen.Height = picScreen.Height + pic3.Height + stbDettagli.Height + 120
  10. frmZoomScreen.Width = picScreen.Width + pic1.Width + 120 * 3
  11. End Sub
  12.  
  13. Private Sub Form_Resize()
  14. picScreen.Height = frmZoomScreen.Height - pic3.Height * 2 - 120
  15. pic3.Top = picScreen.Height + 120
  16. pic2.Top = pic3.Top
  17. picScreen.Width = frmZoomScreen.Width - pic1.Width - 120 * 4
  18. pic3.Width = picScreen.Width
  19. sldZoom.Width = pic3.Width
  20. sldInterval.Width = pic3.Width
  21. pic2.Left = pic3.Width + 120
  22. pic1.Left = picScreen.Width + 120
  23. End Sub
  24.  
  25. Private Sub Form_Unload(Cancel As Integer)
  26. ReleaseDC 0, DC
  27. End Sub
  28.  
  29. Private Sub cmdSalva_Click()
  30. picScreen.AutoRedraw = True
  31. tmrPrelievo.Enabled = False
  32. Prelievo
  33. CDialog.ShowSave
  34.     If CDialog.CancelError = False Then SavePicture picScreen.Image, CDialog.FileName
  35. tmrPrelievo.Enabled = Not CBool(chkStop.Value)
  36. picScreen.AutoRedraw = False
  37. End Sub
  38.  
  39. Private Sub sldInterval_Scroll()
  40. txtInterval = sldInterval.Value
  41. End Sub
  42.  
  43. Private Sub sldZoom_KeyPress(KeyAscii As Integer)
  44.     If KeyAscii = Asc("+") Then sldZoom.Value = sldZoom.Value + 1
  45.     If KeyAscii = Asc("-") Then sldZoom.Value = sldZoom.Value - 1
  46. txtZoom.Text = sldZoom.Value
  47. End Sub
  48.  
  49. Private Sub sldZoom_Scroll()
  50. txtZoom = sldZoom.Value
  51. End Sub
  52.  
  53. Private Sub Prelievo()
  54. Dim Mouse As Pointapi
  55. Dim Dimensione As Pointapi
  56. GetCursorPos Mouse
  57. Dimensione.x = picScreen.ScaleWidth / sldZoom.Value * 100
  58. Dimensione.y = picScreen.ScaleHeight / sldZoom.Value * 100
  59.     If chkRefresh.Value = vbChecked Then picScreen.Refresh
  60.     If chkinvertito.Value = vbChecked Then
  61.         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
  62.     Else
  63.         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
  64.     End If
  65.     'If imgMouse.Visible = True Then picScreen.PaintPicture imgMouse.Picture, Dimensione.x / 2, Dimensione.y / 2
  66. stbDettagli.Panels(1).Text = "Coordina X del mouse: " & Mouse.x
  67. stbDettagli.Panels(2).Text = "Coordina Y del mouse: " & Mouse.y
  68. End Sub
  69.  
  70. Private Sub tmrPrelievo_Timer()
  71. Prelievo
  72. End Sub
  73.  
  74. Private Sub txtInterval_Change()
  75. txtInterval = Val(txtInterval)
  76. sldInterval.Value = txtInterval
  77. tmrPrelievo.Interval = txtInterval
  78. End Sub
  79.  
  80. Private Sub txtInterval_GotFocus()
  81. txtInterval.SelStart = 0
  82. txtInterval.SelLength = Len(txtInterval)
  83. End Sub
  84.  
  85. Private Sub txtZoom_Change()
  86. sldZoom.Value = Val(txtZoom)
  87. txtZoom = Val(txtZoom)
  88. End Sub
  89.  
  90. Private Sub txtZoom_GotFocus()
  91. txtZoom.SelStart = 0
  92. txtZoom.SelLength = Len(txtZoom)
  93. End Sub