Salut a tous !,
Aujourd'hui vous allez apprendre comment créer un ScreenShooteur ,
[ Se qui permet de prendre une image de son écran ]
Et je pense que c'est utile pour certains ...
Parceque vraiment facile
-On commence ?
-Oui ...
Vous aurrez besoin de:
-2 boutons (1: Screen, 2: Enregistrer)
-1 Picturebox
-1 SaveFileDialog
Code:
Bouton1 : (Screen)
Code :
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
Bouton2 : (Enregistrer)
Code :
Dim savefiledialog1 As New SaveFileDialog
Try
savefiledialog1.Title = "Save File"
savefiledialog1.FileName = "*.bmp"
savefiledialog1.Filter = "Bitmap |*.bmp"
If savefiledialog1.ShowDialog() = DialogResult.OK Then
PictureBox1.Image.Save(savefiledialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
End If
Catch ex As Exception
'Do Nothing
End Try
Vous finis votre screen shooter !
Aujourd'hui vous allez apprendre comment créer un ScreenShooteur ,
[ Se qui permet de prendre une image de son écran ]
Et je pense que c'est utile pour certains ...
Parceque vraiment facile
-On commence ?
-Oui ...
Vous aurrez besoin de:
-2 boutons (1: Screen, 2: Enregistrer)
-1 Picturebox
-1 SaveFileDialog
Code:
Bouton1 : (Screen)
Code :
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
Bouton2 : (Enregistrer)
Code :
Dim savefiledialog1 As New SaveFileDialog
Try
savefiledialog1.Title = "Save File"
savefiledialog1.FileName = "*.bmp"
savefiledialog1.Filter = "Bitmap |*.bmp"
If savefiledialog1.ShowDialog() = DialogResult.OK Then
PictureBox1.Image.Save(savefiledialog1.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
End If
Catch ex As Exception
'Do Nothing
End Try
Vous finis votre screen shooter !