16 Haziran 2013 Pazar

Gerekenler;1 ADET picture box
2 adet button [ isimleri resim çek ve kaydet butonları olsun]

Kod:
resim çek butonuna;

 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

kaydet butonuna;

Dim savefiledialog1 As New SaveFileDialog
        Try
            savefiledialog1.Title = "Save File"
            savefiledialog1.FileName = "*.jpeg"
            savefiledialog1.Filter = "JPEG |*.jpeg"
            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

0 yorum:

Yorum Gönder

Subscribe to RSS Feed Follow me on Twitter!