إقتباس :اتمنى تحاول معي حتى نصل للمطلوب ان شاء اللهليه تتمنى اخي الكريم
احنا نساعد بعض قل "أرجو"
انت لا تضيف شيء ابد فقط اضف الفورم من المثال الى مشروعك بعد ان تضيف ملف Directshow.dll الى الـ REference في مشروعك ثم اعرف اسم الـ Namespace الذي كتبه في اعلى الفورم وعند التعامل مع هذا الفورم قم باستدعائه اولا قبل استدعاء الفورم
مثلا
كود :
Namespace MyCam
كود :
MyCam.Form2.Show()
كود :
If CheckBox1.Checked Then
Timer1.Start()
End If
MyCam.Form2.Show()
وروتين سحب صور متعددة هو هذا
كود :
Function GetScreenShoot(ByVal drawCursor As Boolean) As Image
Dim bounds As Rectangle = Nothing
Dim screenshot As System.Drawing.Bitmap = Nothing
Dim g As Graphics = Nothing
bounds = MyCam.Form2.Bounds 'Screen.PrimaryScreen.Bounds
'screenshot = New System.Drawing.Bitmap(bounds.Width, bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
screenshot = New System.Drawing.Bitmap(bounds.Width, My.Computer.Screen.WorkingArea.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
g = Graphics.FromImage(screenshot)
g.CopyFromScreen(bounds.X, bounds.Y, 0, 0, bounds.Size, CopyPixelOperation.SourceCopy)
If DrawCursor Then
Me.Cursor.Draw(g, New Rectangle(Windows.Forms.Cursor.Position, Me.Cursor.Size))
End If
'***********************
Dim pic As New PictureBox
pic.Image = screenshot
pic.SizeMode = PictureBoxSizeMode.StretchImage
pic.Image.Save(TextBox1.Text & "p" & m2 & ".jpg")
'*********************
m2 += 1
Return screenshot
End Function
كود :
GetScreenShoot(False)
كود :
Dim fbd As New FolderBrowserDialog
If fbd.ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.Text = fbd.SelectedPath
If TextBox1.Text.EndsWith("\") = False Then
TextBox1.Text = TextBox1.Text.Insert(TextBox1.TextLength, "\")
End If
End If