public Main() { InitializeComponent(); Options settingsForm = new Options(); CropBox.pictureBox1 = pictureBox1; WebCam.GetCamListCombobox(settingsForm.OptionsWebCamList); WebCam.GetCamSettingsCombobox(settingsForm.OptionsWebCamSettings); WebCam.GetVideoImage(pictureBox1); if (Properties.Settings.Default.autoStart == true) { CamStart(); } }
private void options_Click(object sender, EventArgs e) { CamStop(); Options settingsForm = new Options(); // Show the settings form DialogResult dr = settingsForm.ShowDialog(this); if (dr == DialogResult.Cancel) { settingsForm.Close(); } else if (dr == DialogResult.OK) { saveLocation = Options.optionsLocation; Properties.Settings.Default.WebCamDevice = Convert.ToString(settingsForm.OptionsWebCamList.SelectedItem); Properties.Settings.Default.WebCamResolution = Convert.ToString(settingsForm.OptionsWebCamSettings.SelectedItem); Properties.Settings.Default.Ratio = Convert.ToString(settingsForm.OptionsCropBoxRatioCombobox.SelectedItem); Properties.Settings.Default.SaveLocation = settingsForm.savePath.Text; Properties.Settings.Default.scaleEnabled = Options.scaleEnabled; Properties.Settings.Default.scaleHeight = settingsForm.OptionsScaleHeightTextBox.Text; Properties.Settings.Default.scaleWidth = settingsForm.OptionsScaleWidthTextBox.Text; Properties.Settings.Default.autoStart = Options.autoStart; Properties.Settings.Default.Save(); settingsForm.Close(); } CamStart(); }