تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
اظهار صورة ملتقطة من webcam في DATAGRIDVIEW
#1
السلام عليكم
استخدم حاليا webcam لالتقاط صور ثم حفظها في الكمبيوتر ولكني لدي داتاقريد أود اظهار الصور الملتقطة فيها بعد الضغط على زر الالتقاط 

i used a webcam to capture pictures and save it to my computer now i would like to show every picture tooked in a column in my DATAGRIDVIEW i added a new column to my datagrid, but i did not find a way to show them i want when i click capture button == > save it directly in my computer at the same time show it to my datagridview


كود :
Private Sub frmWeight_Load(sender As Object, e As EventArgs) Handles MyBase.Load

   DataGridView1.DataSource = vbEmpty
   DataGridView1.Columns.Clear()

   Dim table As New DataTable

   table.Columns.Add("Picture_name", GetType(String))
   table.Columns.Add("Gewicht", GetType(String))
   btnWeiter.Enabled = False


  HERE I ADDED THE IMAGE COLUMN  '

 Dim dgvImageColumn As New DataGridViewImageColumn
    dgvImageColumn.DataPropertyName = "ActualPaketImage"
    dgvImageColumn.Name = "ActualPaketImage"
    dgvImageColumn.ImageLayout = DataGridViewImageCellLayout.Zoom
    DataGridView1.Columns.Add(dgvImageColumn)

    DataGridView1.DataSource = table


    With Me.DataGridView1.RowTemplate
      .DefaultCellStyle.BackColor = Color.Bisque
      .Height = 150
      .MinimumHeight = 20
    End With
    Me.DataGridView1.DataSource = table
    Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
    DataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
    Me.DataGridView1.DefaultCellStyle = DataGridViewCellStyle1
    Me.DataGridView1.Columns(0).Width = 120
    Me.DataGridView1.Columns(1).Width = 120
    Me.DataGridView1.Columns(2).Width = 400




End sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

   Try
     PictureBox1.Image = Capture.QueryFrame.ToBitmap()
   Catch ex As Exception
     Capture = New Emgu.CV.Capture
   End Try

 End Sub
 ' start the webcam
 Private Sub startWebcam_Click(sender As Object, e As EventArgs) Handles startWebcam.Click
   Timer1.Start()

 End Sub

 Private pakNum As Integer = 0


 Private Sub captWebcam_Click(sender As Object, e As EventArgs) Handles captWebcam.Click

   Timer1.Stop()

   'Save the picture

   pakNum += 1
   PictureBox1.Image.Save("D:\WEBCAM\Img" & strBarcode & "-" & pakNum.ToString("00") & ".JPEG", Imaging.ImageFormat.Jpeg)
   capture.Dispose()

   startWebcam.Visible = False

   Timer1.Start()
 End Sub
الرد }}}
تم الشكر بواسطة:
#2
(04-03-20, 01:26 PM)nasro.betz كتب : السلام عليكم
استخدم حاليا webcam لالتقاط صور ثم حفظها في الكمبيوتر ولكني لدي داتاقريد أود اظهار الصور الملتقطة فيها بعد الضغط على زر الالتقاط 

i used a webcam to capture pictures and save it to my computer now i would like to show every picture tooked in a column in my DATAGRIDVIEW i added a new column to my datagrid, but i did not find a way to show them i want when i click capture button == > save it directly in my computer at the same time show it to my datagridview


كود :
Private Sub frmWeight_Load(sender As Object, e As EventArgs) Handles MyBase.Load

   DataGridView1.DataSource = vbEmpty
   DataGridView1.Columns.Clear()

   Dim table As New DataTable

   table.Columns.Add("Picture_name", GetType(String))
   table.Columns.Add("Gewicht", GetType(String))
   btnWeiter.Enabled = False

   Dim img As New DataGridViewImageColumn()

   table.Columns.Add("picture")
   img.HeaderText = "picture"
   Img.Name = "img"
End sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

   Try
     PictureBox1.Image = Capture.QueryFrame.ToBitmap()
   Catch ex As Exception
     Capture = New Emgu.CV.Capture
   End Try

 End Sub
 ' start the webcam
 Private Sub startWebcam_Click(sender As Object, e As EventArgs) Handles startWebcam.Click
   Timer1.Start()

 End Sub

 Private pakNum As Integer = 0


 Private Sub captWebcam_Click(sender As Object, e As EventArgs) Handles captWebcam.Click

   Timer1.Stop()

   'Save the picture

   pakNum += 1
   PictureBox1.Image.Save("D:\WEBCAM\Img" & strBarcode & "-" & pakNum.ToString("00") & ".JPEG", Imaging.ImageFormat.Jpeg)
   capture.Dispose()

   startWebcam.Visible = False

   Timer1.Start()
 End Sub

كود :
table.Columns.Add("picture",gettype(byte()))
الرد }}}
تم الشكر بواسطة: ابراهيم ايبو
#3


واعبد ربك حتى يأتيك اليقين
الرد }}}
تم الشكر بواسطة: ابراهيم ايبو
#4
لم تشتغل معي
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [VB.NET] محتاج اربط DataGridView بزر بحث bakrycold 1 549 28-02-25, 12:11 AM
آخر رد: bakrycold
  [VB.NET] استعراض بيانات في Datagridview واضافة جميع البيانات لجدول محدد sql skode 0 486 12-01-25, 12:50 AM
آخر رد: skode
  احتاج مساعدة في اظهار الصورة على PictureBox sloom00 2 387 31-12-24, 11:29 PM
آخر رد: sloom00
Information [VB.NET] تنسيق أعمدة DataGridView أبو خالد الشكري 3 570 21-12-24, 02:40 PM
آخر رد: aljzazy
  إدراج صورة الموظف من خلال رابط في حقل من قاعدة البيانات saud1004 4 524 13-12-24, 04:48 AM
آخر رد: saud1004
Lightbulb [سؤال] تحويل صورة الى ملف Pdf ackore 8 757 27-09-24, 07:51 PM
آخر رد: محمد مسافر
  اضافة صورة مخزنة في قاعدة البيانات sql الى الكريستال ريبورت صالح عبدالله 3 460 24-09-24, 09:52 AM
آخر رد: صالح عبدالله
  [كود] كود عند اختيار صورة في فورم تسمع في فورم اخري Mostafa201255411 0 242 13-09-24, 09:20 PM
آخر رد: Mostafa201255411
  التعامل مع موقع ويب لجلب صورة لالفيجوال بيزك صبري زينوبي 3 438 09-09-24, 11:22 PM
آخر رد: Taha Okla
Exclamation [VB.NET] اريد كود لتصدير البيانات من DataGridView الى ملف Excel zazasami 1 492 04-08-24, 09:15 PM
آخر رد: mrfenix93

التنقل السريع :


يقوم بقرائة الموضوع: