تقييم الموضوع :
  • 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
لم تشتغل معي
الرد }}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  تعديل كود ارسال صورة الى الواتس new_programer 2 114 21-03-24, 10:07 PM
آخر رد: new_programer
  تعديل بيانات عمود DataGridView دفعة واحدة مصمم هاوي 2 164 05-03-24, 08:27 PM
آخر رد: مصمم هاوي
  فلترة datagridview بدون قاعدة بيانات صالح عبدالله 3 295 02-02-24, 04:07 PM
آخر رد: صالح عبدالله
  [VB.NET] ظهور التاريخ غير مرتب بالأقدم في datagridview مبرمج صغير 1 4 304 26-01-24, 03:41 PM
آخر رد: atefkhalf2004
  [VB.NET] التاريخ في أداة أبو سامر لطباعة DataGridView مبرمج صغير 1 17 629 26-01-24, 01:52 AM
آخر رد: مبرمج صغير 1
  مشكلة في datagridview Adata 4 310 17-01-24, 03:00 PM
آخر رد: aljzazy
  [سؤال] كود اظهار رساله في حال وجود الرقم في اكثر من عمود مبرمج صغير 1 6 402 09-01-24, 01:41 AM
آخر رد: Taha Okla
Lightbulb [VB.NET] إطهار الصورة بمقاس معين في DataGridView أبو خالد الشكري 2 323 14-12-23, 03:01 PM
آخر رد: أبو خالد الشكري
Question [VB.NET] اسم عمود الأرقام في DataGridView أبو خالد الشكري 6 606 03-12-23, 08:01 AM
آخر رد: أبو خالد الشكري
  [VB.NET] Datagridview Slow حركة بطيئة waataanys 1 294 20-11-23, 04:33 PM
آخر رد: justforit

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


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم