Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB.NET
Imports AForge.Video
Imports AForge.Video.DirectShow
Imports AForge.Controls
Public Class Imagecapture
    Private videodevices As FilterInfoCollection
    Private videosource As VideoCaptureDevice
    Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click

    End Sub

    Private Sub Imagecapture_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        videodevices = New FilterInfoCollection(FilterCategory.VideoInputDevice)

        For Each device As FilterInfo In videodevices
            ComboBox1.Items.Add(device.Name)
        Next
        videosource = New VideoCaptureDevice()
    End Sub

    Private Sub btnstartstop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnstartstop.Click
        If (videosource.IsRunning) Then
            videosource.Stop()
            PictureBox1.Image = Nothing
            PictureBox1.Invalidate()
        Else

            videosource = New VideoCaptureDevice(videodevices(ComboBox1.SelectedIndex).MonikerString)
            'set new frame event handler
            videosource.NewFrame += New NewFrameEventArgs(videosource_newframe)

        End If

    End Sub
    Sub videosource_newframe(ByVal sender As Object, ByVal eventArgs As NewFrameEventArgs)

    End Sub
End Class


What I have tried:

videosource.NewFrame += New NewFrameEventArgs(videosource_newframe)

Inthis NewFrame event showing error always
Posted
Updated 19-Oct-16 0:28am
v2
Comments
Suvendu Shekhar Giri 19-Oct-16 6:05am    
not working meaning?
giving any error or different result than expected?
RajkumarGnanaraj 19-Oct-16 6:12am    
not giving error it is not showing in videosource event list
Karthik_Mahalingam 19-Oct-16 12:27pm    
Always use  Reply   button to post comments/query to the concerned user, so that the user gets notified and respond to your text.
Eric Tranggono 4-Apr-21 9:30am    
so whats the solution?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900