Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Visual basic- Screenshot program,obiฤan sa save opcijom
- Potrebno: 1 Button,1 Label,1 PictureBox
- Public Class Form1
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Me.Hide()
- PictureBox1.Image = Nothing
- Dim bounds As Rectangle
- Dim screenshot As System.Drawing.Bitmap
- Dim graph As Graphics
- bounds = Screen.PrimaryScreen.Bounds
- screenshot = New 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
- If SaveFileDialog1.ShowDialog = DialogResult.OK Then
- Label1.Text = SaveFileDialog1.FileName
- Me.Hide()
- End If
- PictureBox1.Image.Save(System.IO.Path.Combine(Label1.Text + ".png"))
- Me.Show()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement