mars073 Posté(e) March 13, 2014 Signaler Share Posté(e) March 13, 2014 Bonjour, je vais faire un tuto différent que d'habitude... Alors il vous faut : -1 Picturebox -4 boutons (start;stop;supprimer;enregistrer) -1 SaveFileDialog -1 Timer (Interval: 1) PS: si vous utilisez aussi des PicturesBoxs pour faire vos boutons en plus personnalisé, mettez comme couleur d'arrière plan: "transparent" dans l'onglet "web" Double click sur le Timer mettez le code: Me.BackgroundImage = PictureBox1.Image Dim bounds As Rectangle Dim screenshot As System.Drawing.Bitmap Dim qraph As Graphics bounds = Screen.PrimaryScreen.Bounds screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb) qraph = Graphics.FromImage(screenshot) qraph.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy) PictureBox1.Image = screenshot Double click sur le bouton (start) mettez le code: Timer1.start() Double click sur le bouton (stop) mettez le code: Timer1.stop() Double click sur le bouton (supprimer) mettez le code: PictureBox1.Image = Nothing Me.BackgroundImage = Nothing Double click sur le bouton (enregister) mettez le code: Dim savefiledialog1 As New SaveFileDialog Try savefiledialog1.Title = "Enregistrer" savefiledialog1.FileName = "*.PNG" savefiledialog1.Filter = "Image PNG |*.Png" If savefiledialog1.ShowDialog() = DialogResult.OK Then PictureBox1.Image.Save(savefiledialog1.FileName, System.Drawing.Imaging.ImageFormat.Png) End If Catch ex As Exception End Try Programme : NSW.exe Contrôle VirusTotal Cordialement, Mars073 Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Azad Posté(e) March 13, 2014 Signaler Share Posté(e) March 13, 2014 Excellent tutoriel ! Merci bien, utile pour ceux qui se lancent dans le VB.Net et qui veulent s'exercer. Citer Lien vers le commentaire Partager sur d’autres sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.