Follow along with the video below to see how to install our site as a web app on your home screen.
Not: This feature may not be available in some browsers.
Visual Basic Kategorisini İncele
[COLOR="Red"]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[/COLOR]
Dim savefiledialog1 As New SaveFileDialog
[COLOR="red"] 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[/COLOR]
Private Sub Command1_Click()
If Check1.Value = vbChecked Then Me.WindowState = vbMinimized 'işaretlenmişse pencereyi minimize et
Timer1.Enabled = True ' timer çalıştır
End Sub
Private Sub Timer1_Timer()
On Error GoTo err:
Call keybd_event(vbKeySnapshot, 1, 0, 0) 'ekran yakalama anahtarını çağır
DoEvents ' windows'a bir fırsat verelim, işi varsa bitirsin :=)
SavePicture Clipboard.GetData(vbCFBitmap), "c:ekran.bmp" ' clipboard'a resmi kaydet
If Me.WindowState = vbMinimized Then Me.WindowState = vbNormal ' normal duruma dön
Timer1.Enabled = False 'timer'ı kapat
MsgBox "Ekranı kaydettim:" & vbCrLf & "Masaüstünde az önce yakalanan ekranın görüntüsü var." & vbCrLf & "ekran.bmp"
'Yakalanan ekran resmi bmp olduğu için 1.4 Mb yer tutuyor.
'Ancak gif'e çevirirseniz 30-80 kb'ye kadar düşürebilirsiniz.
Exit Sub
err:
MsgBox "Error numarası: " & err.Number & ". " & err.Description
End Sub