public Form1() { InitializeComponent(); this.pipec = new Client(); vidPathFinal = @"C:\Videos"; pipec.MessageReceived += new Client.MessageReceivedHandler(pipeClient_MessageReceived); mytime.Interval = 1000; mytime.Tick += timing; if (Directory.Exists(vidPathFinal) == false) { Directory.CreateDirectory(vidPathFinal); } DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); WebCams = new Video_Device[_SystemCamereas.Length]; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device(i, _SystemCamereas[i].Name, _SystemCamereas[i].ClassID); //fill web cam array Camera_Selection.Items.Add(WebCams[i].ToString()); } if (Camera_Selection.Items.Count > 0) { Camera_Selection.SelectedIndex = 0; //Set the selected device the default } }
/********************************************************** * load default values to UI **********************************************************/ public VisionApp() { InitializeComponent(); label1.Text = "Created by:\nAram Gasparian\nRahamim Workenech"; calibrationPath.Text = @"C:\Users\aram8\Desktop\calib"; baseTime = DateTime.Now; #region Find systems cameras with DirectShow.Net dll // Find systems cameras with DirectShow.Net dll DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); WebCams = new Video_Device[_SystemCamereas.Length]; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device(i, _SystemCamereas[i].Name); //fill web cam array Camera_Selection_Left.Items.Add(WebCams[i].ToString()); Camera_Selection_Right.Items.Add(WebCams[i].ToString()); } if (Camera_Selection_Left.Items.Count > 0) { Camera_Selection_Left.SelectedIndex = 0; //Set the selected device the default Camera_Selection_Right.SelectedIndex = 0; //Set the selected device the default } #endregion }
//Get camera information private void cameraInformation() { DsDevice[] systemCameras = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); webCams = new Video_Device[systemCameras.Length]; for (int i = 0; i < systemCameras.Length; i++) { webCams[i] = new Video_Device(i, systemCameras[i].Name, systemCameras[i].ClassID); //fill web cam array } richTextBox.AppendText("Camera name: " + webCams[cameraDevice].Device_Name + "\n\n"); }
internal Video_Device[] InitCameraList() { Video_Device[] WebCams; //List containing all the camera available DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); WebCams = new Video_Device[_SystemCamereas.Length]; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device(i, _SystemCamereas[i].Name, _SystemCamereas[i].ClassID); //fill web cam array // comboBoxCamera.Items.Add(WebCams[i].ToString()); } return(WebCams); }
public Form1() { InitializeComponent(); //set up chessboard drawing array Random R = new Random(); for (int i = 0; i < line_colour_array.Length; i++) { line_colour_array[i] = new Bgr(R.Next(0, 255), R.Next(0, 255), R.Next(0, 255)); } //Set up the capture method //-> Find systems cameras with DirectShow.Net dll //thanks to carles lloret DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); Video_Device[] WebCams = new Video_Device[_SystemCamereas.Length]; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device(i, _SystemCamereas[i].Name, _SystemCamereas[i].ClassID); } //check to see what video inputs we have available if (WebCams.Length < 2) { if (WebCams.Length == 0) { throw new InvalidOperationException("A camera device was not detected"); } MessageBox.Show("Only 1 camera detected. Stero Imaging can not be emulated"); } else if (WebCams.Length >= 2) { if (WebCams.Length > 2) { MessageBox.Show("More than 2 cameras detected. Stero Imaging will be performed using " + WebCams[0].Device_Name + " and " + WebCams[1].Device_Name); } _Capture1 = new Capture(WebCams[0].Device_ID); _Capture2 = new Capture(WebCams[1].Device_ID); //We will only use 1 frame ready event this is not really safe but it fits the purpose _Capture1.ImageGrabbed += ProcessFrame; //_Capture2.Start(); //We make sure we start Capture device 2 first _Capture1.Start(); } }
public MainWindow() { InitializeComponent(); //Analysis(); DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); WebCams = new Video_Device[_SystemCamereas.Length]; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device(i, _SystemCamereas[i].Name, _SystemCamereas[i].ClassID); //fill web cam array Camera_Selection.Items.Add(WebCams[i].ToString()); } if (Camera_Selection.Items.Count > 0) { Camera_Selection.SelectedIndex = 0; //Set the selected device the default } InitCapture(0); }
public Camera_Selector(Form1 _Owner) { InitializeComponent(); Owner = _Owner; DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); WebCams = new Video_Device[_SystemCamereas.Length]; Camera_Count = _SystemCamereas.Length; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device(i, _SystemCamereas[i].Name, _SystemCamereas[i].ClassID); //fill web cam array Camera_Selection.Items.Add(WebCams[i].ToString()); } if (Camera_Selection.Items.Count > 0) { Camera_Selection.SelectedIndex = 0; //Set the selected device the default BTN_Capture.Enabled = true; //Enable the start } }
private void Form1_Load(object sender, EventArgs e) { oldImage = pictureBox2.Image; DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); WebCams = new Video_Device[_SystemCamereas.Length]; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device() { Id = i, Name = _SystemCamereas[i].Name, ClassID = _SystemCamereas[i].ClassID }; //fill web cam array comboBox1.Items.Add(WebCams[i].Name); } foreach (var map in GMapProviders.List) { comboBox2.Items.Add(map); } dt = new DataTable(); dt.Columns.Add(new DataColumn("Tanım", typeof(string))); dt.Columns.Add(new DataColumn("Latitude", typeof(double))); dt.Columns.Add(new DataColumn("Longitude", typeof(double))); dataGridView1.DataSource = dt; comboBox1.SelectedIndex = 0; //Gmap Controlller gMapControl1.DragButton = MouseButtons.Left; gMapControl1.CanDragMap = true; gMapControl1.MapProvider = GMapProviders.GoogleSatelliteMap; gMapControl1.Position = new PointLatLng(latIn, lngIn); gMapControl1.MinZoom = 0; gMapControl1.MaxZoom = 23; gMapControl1.Zoom = 5; gMapControl1.AutoScroll = true; }
public CameraCapture() { InitializeComponent(); Slider_Enable(false); //Disable sliders untill capturing //-> Find systems cameras with DirectShow.Net dll //thanks to carles lloret DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); WebCams = new Video_Device[_SystemCamereas.Length]; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device(i, _SystemCamereas[i].Name, _SystemCamereas[i].ClassID); //fill web cam array Camera_Selection.Items.Add(WebCams[i].ToString()); } if (Camera_Selection.Items.Count > 0) { Camera_Selection.SelectedIndex = 0; //Set the selected device the default captureButton.Enabled = true; //Enable the start } }
public CameraSelection() { InitializeComponent(); DsDevice[] _SystemCamereas = DsDevice.GetDevicesOfCat(FilterCategory.VideoInputDevice); WebCams = new Video_Device[_SystemCamereas.Length]; for (int i = 0; i < _SystemCamereas.Length; i++) { WebCams[i] = new Video_Device(i, _SystemCamereas[i].Name, _SystemCamereas[i].ClassID); //fill web cam array comboBox1.Items.Add(WebCams[i].ToString()); } if (comboBox1.Items.Count > 0) { comboBox1.SelectedIndex = 0; } else { MessageBox.Show("There is no web-cam\n", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); this.Close(); Application.Exit(); } }