If File.Exists("C:\screen.bmp") Then System.Threading.Thread.Sleep(2000) 'on marque une pause de 2 secondes File.Delete("C:\screen.bmp") Else .... End If
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question'Déclaration de variables Dim Bounds As Rectangle Dim Capture As System.Drawing.Bitmap Dim Graph As Graphics If File.Exists("C:\screen.bmp") Then File.Delete("C:\screen.bmp") Else On Error Resume Next End If Bounds = Screen.PrimaryScreen.Bounds 'définition de la taille de l'écran 'Création de l'image Capture = New System.Drawing.Bitmap(Bounds.Width, Bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppPArgb) Graph = Graphics.FromImage(Capture) Graph.CopyFromScreen(Bounds.X, Bounds.Y, 0, 0, Bounds.Size, CopyPixelOperation.SourceCopy) 'Insertion de l'image PictureBox1.Image = Capture PictureBox1.Image.Save("C:\screen.bmp") End Sub [................] PictureBox1.Dispose() 'libere la picturebox Capture = Nothing 'libère le curseur