Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports AForge.Video.DirectShow
- Public Class Form1
- Private Dispositivos As FilterInfoCollection
- Private FuenteDeVideo As VideoCaptureDevice
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- 'AGREGAR REFERENCIAS
- 'AGREGAR CONTROL
- 'DISEÑAR FORMULARIO
- Dispositivos = New FilterInfoCollection(FilterCategory.VideoInputDevice)
- For Each x As FilterInfo In Dispositivos
- ComboBox1.Items.Add(x.Name)
- Next
- ComboBox1.SelectedIndex = 0
- End Sub
- Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
- FuenteDeVideo = New VideoCaptureDevice(Dispositivos(ComboBox1.SelectedIndex).MonikerString)
- VideoSourcePlayer1.VideoSource = FuenteDeVideo
- VideoSourcePlayer1.Start()
- End Sub
- Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
- VideoSourcePlayer1.SignalToStop()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment