الكود دا لاتقاط صور بس للاسف بيلتقط صورة للفورم فقط و يعمل save as انا عاوز كود لاتقاط الشاشة بالكامل مع حفظ تلقائي للصورة في ملف انا احدده في الكود نفسه
Dim img As New Bitmap(Width, Height)
DrawToBitmap(img, New Rectangle(New Point(0, 0), Size))
Dim opn As New SaveFileDialog
opn.Filter = "*.png|*.png"
If opn.ShowDialog = Windows.Forms.DialogResult.OK Then
img.Save(opn.FileName, Imaging.ImageFormat.Png)
End If
(11-07-21, 09:20 PM)trakktour كتب : كل ما عليك هو تغيير اسم الصورة عند الحفظ حتى لا تحذف القديمة
بتوفيق لك
تمام الف شكر لحضرتك
تفضل يا عزيزي
غير الكود بذات المثال المرفق امسح كل ما به و استبدله بالتالي
PHP كود :
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Opacity = 0 My.Computer.Audio.Play(My.Resources.camera_shutterclick, AudioPlayMode.Background) Dim bounds As Rectangle Dim screenshot As System.Drawing.Image 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) Me.Opacity = 100 Dim pb As New PictureBox pb.Image = screenshot 'pb.Image.Save("d:\screenshoot.Jpg") Static Count As Integer Count += 1 pb.Image.Save(("d:\screenshoot" & Count.ToString & ".jpg"), System.Drawing.Imaging.ImageFormat.Jpeg) End Sub End Class