ScreenCheese:
Public Class Form1
Private Sub ButtonX2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX2.Click
Dim sfd As New SaveFileDialog
Try
sfd.Title = "salva cattura"
sfd.FileName = ".bmp"
sfd.Filter = " Bitmap| *.bmp| Piennegi |*.png| GIF |*.gif| JPEG |*.jpg"
If sfd.ShowDialog = DialogResult.OK Then
PictureBox1.Image.Save(sfd.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
MsgBox(" Cattura salvata con successo", MsgBoxStyle.Information)
End If
Catch ex As Exception
MsgBox("Errore imprevisto dell' applicazione", MsgBoxStyle.Exclamation)
End Try
End Sub
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBarX1.Increment(20)
If ProgressBarX1.Value = ProgressBarX1.Maximum Then
Me.Opacity = 0
Me.ShowInTaskbar = False
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
Me.Opacity = 100
Me.ShowInTaskbar = True
Timer1.Stop()
ProgressBarX1.Value = 0
End If
End Sub
End Class
______________________________________________________________________________
Copia e incolla questo link nel tuo progetto.
Buttonx1: cattura
Buttonx2: Salva
Nessun commento:
Posta un commento