[VB]Crée une form qui prend des screen et qui peut les save !

    Publicités

Users Who Are Viewing This Thread (Total: 0, Members: 0, Guests: 0)

Nalik

Membre
May 11, 2010
17
0
566
31
1)Mettez 2 boutons
2)Mettez 1 PictureBox
3)Mettez 1 Timer

Code:

Bouton pour prendre le screen:
Code:
        Me.Opacity = 0
        Timer1.Enabled = True
        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

Bouton pour sauvegarder:

Code:
        'Save Code
        Dim savefiledialog1 As New SaveFileDialog
        Try
            savefiledialog1.Title = "Save File"
            savefiledialog1.FileName = "*.bmp"
            savefiledialog1.FileName = "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

timer:

Code:
        Me.Opacity = 100
        Timer1.Enabled = False

Et voila fini ;)
 

jojodata

Membre actif
Sep 19, 2010
459
0
922
Preum's !
Merci !! t'est grave sympa mec !
Ça fonctionne à merveille !
Je t'adore, je te met un merci.