Exemplo n.º 1
0
        public void Init(ScreenShotConverter cf, bool hires)
        {
            this.hires = hires;
            comboBoxOutputAs.Items.AddRange(Enum.GetNames(typeof(ScreenShotImageConverter.OutputTypes)));
            comboBoxOutputAs.SelectedIndex = (int)cf.OutputFileExtension;
            comboBoxScanFor.Items.AddRange(Enum.GetNames(typeof(ScreenShotImageConverter.InputTypes)));
            comboBoxScanFor.SelectedIndex = (int)cf.InputFileExtension;
            initialssfolder       = textBoxScreenshotsDir.Text = cf.ScreenshotsDir;
            textBoxOutputDir.Text = cf.OutputDir;
            comboBoxSubFolder.Items.AddRange(ScreenShotImageConverter.SubFolderSelections);
            comboBoxSubFolder.SelectedIndex = cf.FolderNameFormat;
            comboBoxFileNameFormat.Items.AddRange(ScreenShotImageConverter.FileNameFormats);
            comboBoxFileNameFormat.SelectedIndex = cf.FileNameFormat;

            checkBoxCropImage.Checked = cf.CropImage;
            numericUpDownTop.Value    = cf.CropArea.Top;
            numericUpDownLeft.Value   = cf.CropArea.Left;
            numericUpDownWidth.Value  = cf.CropArea.Width;
            numericUpDownHeight.Value = cf.CropArea.Height;
            SetNumEnabled();

            textBoxFileNameExample.Text = ScreenShotImageConverter.CreateFileName("Sol", "Earth", "HighResScreenshot_0000.bmp", comboBoxFileNameFormat.SelectedIndex, hires, DateTime.Now);

            BaseUtils.Translator.Instance.Translate(this);
            label_index.Text = this.Text;
        }
        public void Init(ScreenShotConverter cf, bool hires)
        {
            this.hires = hires;
            comboBoxOutputAs.Items.AddRange(Enum.GetNames(typeof(ScreenShotImageConverter.OutputTypes)));
            comboBoxOutputAs.SelectedIndex = (int)cf.OutputFileExtension;
            comboBoxScanFor.Items.AddRange(Enum.GetNames(typeof(ScreenShotImageConverter.InputTypes)));
            comboBoxScanFor.SelectedIndex = (int)cf.InputFileExtension;
            initialssfolder       = textBoxScreenshotsDir.Text = cf.ScreenshotsDir;
            textBoxOutputDir.Text = cf.OutputDir;
            comboBoxSubFolder.Items.AddRange(ScreenShotImageConverter.SubFolderSelections);
            comboBoxSubFolder.SelectedIndex = cf.FolderNameFormat;
            comboBoxFileNameFormat.Items.AddRange(ScreenShotImageConverter.FileNameFormats);
            comboBoxFileNameFormat.SelectedIndex = cf.FileNameFormat;
            string[] opt = new string[] { "Off", "Crop", "Resize" };
            extComboBoxConvert1.Items.AddRange(opt);
            extComboBoxConvert2.Items.AddRange(opt);

            extComboBoxConvert1.SelectedIndex = (int)cf.CropResize1;
            extComboBoxConvert2.SelectedIndex = (int)cf.CropResize2;

            extCheckBoxRemoveOriginal.Checked           = cf.RemoveOriginal;
            extCheckBoxKeepMasterConvertedImage.Checked = cf.KeepMasterConvertedImage;

            numericUpDownTop1.Value    = cf.CropResizeArea1.Top;
            numericUpDownLeft1.Value   = cf.CropResizeArea1.Left;
            numericUpDownWidth1.Value  = cf.CropResizeArea1.Width;
            numericUpDownHeight1.Value = cf.CropResizeArea1.Height;

            extNumericUpDownTop2.Value    = cf.CropResizeArea2.Top;
            extNumericUpDownLeft2.Value   = cf.CropResizeArea2.Left;
            extNumericUpDownWidth2.Value  = cf.CropResizeArea2.Width;
            extNumericUpDownHeight2.Value = cf.CropResizeArea2.Height;

            SetNumEnabled();

            extComboBoxConvert1.SelectedIndexChanged += (s, e) => { SetNumEnabled(); };
            extComboBoxConvert2.SelectedIndexChanged += (s, e) => { SetNumEnabled(); };

            textBoxFileNameExample.Text = ScreenShotImageConverter.CreateFileName("Sol", "Earth", "HighResScreenshot_0000.bmp", comboBoxFileNameFormat.SelectedIndex, hires, DateTime.Now);

            BaseUtils.Translator.Instance.Translate(this);

            label_index.Text = this.Text;
        }