public Gestura() { InitializeComponent(); // Start with the first video devices // Don't do this in the Release build in case the // first devices cause problems. #if DEBUG capture = new Capture(filters.VideoInputDevices[0], filters.AudioInputDevices[0]); capture.CaptureComplete += new EventHandler(OnCaptureComplete); #endif // Update the main menu try { updateMenu(); } catch { } /* start preview automatically */ try { cam[prog_iterations] = new Capture1(VIDEODEVICE, VIDEOWIDTH, VIDEOHEIGHT, VIDEOBITSPERPIXEL, panel1, FRAMERATE); } catch (Exception ex) { MessageBox.Show("Unable to enable/disable preview. Please submit a bug report.\n\n" + ex.Message + "\n\n" + ex.ToString()); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mnuPreview_Click(object sender, EventArgs e) { try { cam[prog_iterations] = new Capture1(VIDEODEVICE, VIDEOWIDTH, VIDEOHEIGHT, VIDEOBITSPERPIXEL, panel1, FRAMERATE); } catch (Exception ex) { MessageBox.Show("Unable to enable/disable preview. Please submit a bug report.\n\n" + ex.Message + "\n\n" + ex.ToString()); } }