Ciao ragazzi.. mi chiamo Alessandro, ho 22 anni e faccio il programmatore cobol (purtroppo alle superiori ci hanno insegnato solo quello).
Mi sto cimentando in VB.net e avrei bisogno di una mano:
In pratica sto cercando di creare un programma che fa degli screenshoot ogni "n" secondi e li salva .. solo che non riesco a capire perche, dopo il primo screen si ferma come se uscisse dal ciclo del "tick".
questo è il codice :
chi mi da una mano??codice:Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Button1.Visible = False Button2.Visible = True Me.Timer1.Interval = 1000 Me.Timer1.Enabled = True Me.Timer1.Start() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Button2.Text = "Stopped" Me.Timer1.Enabled = False End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim bounds As Rectangle Dim Screenshot As System.Drawing.Bitmap Dim graph As Graphics bounds = Screen.PrimaryScreen.Bounds Screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb) graph = Graphics.FromImage(Screenshot) graph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy) PictureBox1.Image = Screenshot Timer1.Enabled = False Dim b As Integer Dim c As String b = b + 1 c = "C:\Users\Michael Scofield\Desktop\" & b & ".jpg" PictureBox1.Image.Save(c, System.Drawing.Imaging.ImageFormat.Bmp) End Sub End Class
Grazie..

Rispondi quotando
