cdiego

Obtener imagenes de webcam con visual basic y aforge

Sep 21st, 2013
1,426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.03 KB | None | 0 0
  1. Imports AForge.Video.DirectShow
  2. Public Class Form1
  3.     Private Dispositivos As FilterInfoCollection
  4.     Private FuenteDeVideo As VideoCaptureDevice
  5.  
  6.     Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  7.         'AGREGAR REFERENCIAS
  8.         'AGREGAR CONTROL
  9.         'DISEÑAR FORMULARIO
  10.         Dispositivos = New FilterInfoCollection(FilterCategory.VideoInputDevice)
  11.         For Each x As FilterInfo In Dispositivos
  12.             ComboBox1.Items.Add(x.Name)
  13.         Next
  14.         ComboBox1.SelectedIndex = 0
  15.     End Sub
  16.  
  17.     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  18.         FuenteDeVideo = New VideoCaptureDevice(Dispositivos(ComboBox1.SelectedIndex).MonikerString)
  19.         VideoSourcePlayer1.VideoSource = FuenteDeVideo
  20.         VideoSourcePlayer1.Start()
  21.  
  22.     End Sub
  23.  
  24.     Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
  25.         VideoSourcePlayer1.SignalToStop()
  26.     End Sub
  27. End Class
Advertisement
Add Comment
Please, Sign In to add comment