Imports DirectX.Capture Public Class Form1 Dim ListOfDevices As New Filters Dim Camera As Filter Dim CaptureInfo As Capture Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load ComboBox1.Items.Clear() Try ListOfDevices = New Filters() Catch ex As Exception MsgBox(ex.Message) : End End Try Dim f As Filter For j = 0 To ListOfDevices.VideoInputDevices.Count - 1 f = ListOfDevices.VideoInputDevices(j) ComboBox1.Items.Add(f.Name) Next End Sub Private Sub ComboBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Camera = ListOfDevices.VideoInputDevices(ComboBox1.SelectedIndex) CaptureInfo = New Capture(Camera, Nothing) CaptureInfo.PreviewWindow = VideoPanel CaptureInfo.Start() End Sub End Class
public static void Main(string[] args) { Application.ThreadException += UIThreadException; Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.Run(new Form1()); } private static void UIThreadException(object sender, ThreadExceptionEventArgs e) { ... } private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) { ... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)