public CameraViewer() { InitializeComponent(); Controls.AddRange(new Control[] { PictureBox, Splitter, ListBox }); ListBox.SelectedIndexChanged += ListBox_SelectedIndexChanged; VideoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); ListBox.Items.AddRange(VideoDevices.Select(x => x.Name).ToArray()); ResizeEnd += CameraViewer_WindowChanged; LocationChanged += CameraViewer_WindowChanged; CameraLayout = new CameraLayout(); Deserialize(MemoryPath); }
public string[] GetCameras() { VideoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); return(VideoDevices.Select(x => x.Name).ToArray()); }
private void MainForm_Load(object sender, EventArgs e) { var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice); Connstr_ComboBox.Items.AddRange(videoDevices.Select(x => x.MonikerString).ToArray()); }