diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index daf90b5d..e939e30e 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.3.1.4")] -[assembly: AssemblyFileVersion("2.3.1.4")] +[assembly: AssemblyVersion("2.3.1.5")] +[assembly: AssemblyFileVersion("2.3.1.5")] [assembly: NeutralResourcesLanguageAttribute("en-CA")] \ No newline at end of file diff --git a/app.manifest b/app.manifest index 147c6dc0..055d8967 100644 --- a/app.manifest +++ b/app.manifest @@ -3,7 +3,7 @@ + version="2.3.1.5"/> True/PM diff --git a/interface/FormAbout.resx b/interface/FormAbout.resx index a7d8e508..37df0be0 100644 --- a/interface/FormAbout.resx +++ b/interface/FormAbout.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Auto Screen Capture 2.3.1.4 ("Boombayah") + Auto Screen Capture 2.3.1.5 ("Boombayah") Developed by Gavin Kendall (2008 - 2020) https://autoscreen.sourceforge.io/ diff --git a/interface/FormKeyboardShortcuts.Designer.cs b/interface/FormKeyboardShortcuts.Designer.cs index 5f7182b4..e0d7bcfc 100644 --- a/interface/FormKeyboardShortcuts.Designer.cs +++ b/interface/FormKeyboardShortcuts.Designer.cs @@ -52,6 +52,10 @@ private void InitializeComponent() this.labelRegionSelectClipboard = new System.Windows.Forms.Label(); this.buttonOK = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); + this.labelRegionSelectAutoSave = new System.Windows.Forms.Label(); + this.textBoxKeyboardShortcutRegionSelectAutoSaveKey = new System.Windows.Forms.TextBox(); + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2 = new System.Windows.Forms.ComboBox(); + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1 = new System.Windows.Forms.ComboBox(); this.SuspendLayout(); // // comboBoxKeyboardShortcutStartScreenCaptureModifier1 @@ -236,9 +240,9 @@ private void InitializeComponent() this.labelCaptureNowArchive.Enabled = false; this.labelCaptureNowArchive.Location = new System.Drawing.Point(12, 97); this.labelCaptureNowArchive.Name = "labelCaptureNowArchive"; - this.labelCaptureNowArchive.Size = new System.Drawing.Size(120, 13); + this.labelCaptureNowArchive.Size = new System.Drawing.Size(116, 13); this.labelCaptureNowArchive.TabIndex = 9; - this.labelCaptureNowArchive.Text = "Capture Now -> Archive"; + this.labelCaptureNowArchive.Text = "Capture Now / Archive"; // // labelCaptureNowEdit // @@ -246,9 +250,9 @@ private void InitializeComponent() this.labelCaptureNowEdit.Enabled = false; this.labelCaptureNowEdit.Location = new System.Drawing.Point(12, 124); this.labelCaptureNowEdit.Name = "labelCaptureNowEdit"; - this.labelCaptureNowEdit.Size = new System.Drawing.Size(102, 13); + this.labelCaptureNowEdit.Size = new System.Drawing.Size(98, 13); this.labelCaptureNowEdit.TabIndex = 13; - this.labelCaptureNowEdit.Text = "Capture Now -> Edit"; + this.labelCaptureNowEdit.Text = "Capture Now / Edit"; // // labelRegionSelectClipboard // @@ -256,16 +260,16 @@ private void InitializeComponent() this.labelRegionSelectClipboard.Enabled = false; this.labelRegionSelectClipboard.Location = new System.Drawing.Point(12, 151); this.labelRegionSelectClipboard.Name = "labelRegionSelectClipboard"; - this.labelRegionSelectClipboard.Size = new System.Drawing.Size(133, 13); + this.labelRegionSelectClipboard.Size = new System.Drawing.Size(129, 13); this.labelRegionSelectClipboard.TabIndex = 17; - this.labelRegionSelectClipboard.Text = "Region Select -> Clipboard"; + this.labelRegionSelectClipboard.Text = "Region Select / Clipboard"; // // buttonOK // - this.buttonOK.Location = new System.Drawing.Point(206, 186); + this.buttonOK.Location = new System.Drawing.Point(206, 214); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(99, 23); - this.buttonOK.TabIndex = 21; + this.buttonOK.TabIndex = 25; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -273,20 +277,63 @@ private void InitializeComponent() // buttonCancel // this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(311, 186); + this.buttonCancel.Location = new System.Drawing.Point(311, 214); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(99, 23); - this.buttonCancel.TabIndex = 22; + this.buttonCancel.TabIndex = 26; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; // + // labelRegionSelectAutoSave + // + this.labelRegionSelectAutoSave.AutoSize = true; + this.labelRegionSelectAutoSave.Enabled = false; + this.labelRegionSelectAutoSave.Location = new System.Drawing.Point(12, 178); + this.labelRegionSelectAutoSave.Name = "labelRegionSelectAutoSave"; + this.labelRegionSelectAutoSave.Size = new System.Drawing.Size(135, 13); + this.labelRegionSelectAutoSave.TabIndex = 21; + this.labelRegionSelectAutoSave.Text = "Region Select / Auto Save"; + // + // textBoxKeyboardShortcutRegionSelectAutoSaveKey + // + this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.Enabled = false; + this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.Location = new System.Drawing.Point(370, 175); + this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.MaxLength = 1; + this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.Name = "textBoxKeyboardShortcutRegionSelectAutoSaveKey"; + this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.Size = new System.Drawing.Size(40, 20); + this.textBoxKeyboardShortcutRegionSelectAutoSaveKey.TabIndex = 24; + // + // comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2 + // + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Enabled = false; + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.FormattingEnabled = true; + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Location = new System.Drawing.Point(277, 175); + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Name = "comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2"; + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Size = new System.Drawing.Size(87, 21); + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.TabIndex = 23; + // + // comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1 + // + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Enabled = false; + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.FormattingEnabled = true; + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Location = new System.Drawing.Point(184, 175); + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Name = "comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1"; + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Size = new System.Drawing.Size(87, 21); + this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.TabIndex = 22; + // // FormKeyboardShortcuts // this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(422, 216); + this.ClientSize = new System.Drawing.Size(422, 249); + this.Controls.Add(this.labelRegionSelectAutoSave); + this.Controls.Add(this.textBoxKeyboardShortcutRegionSelectAutoSaveKey); + this.Controls.Add(this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2); + this.Controls.Add(this.comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1); this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.labelRegionSelectClipboard); @@ -348,5 +395,9 @@ private void InitializeComponent() private System.Windows.Forms.Label labelRegionSelectClipboard; private System.Windows.Forms.Button buttonOK; private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Label labelRegionSelectAutoSave; + private System.Windows.Forms.TextBox textBoxKeyboardShortcutRegionSelectAutoSaveKey; + private System.Windows.Forms.ComboBox comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2; + private System.Windows.Forms.ComboBox comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1; } } \ No newline at end of file diff --git a/interface/FormKeyboardShortcuts.cs b/interface/FormKeyboardShortcuts.cs index 445844ab..c8ae1f49 100644 --- a/interface/FormKeyboardShortcuts.cs +++ b/interface/FormKeyboardShortcuts.cs @@ -98,6 +98,16 @@ private void FormKeyboardShortcuts_Load(object sender, EventArgs e) comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Items.Add(AutoScreenCapture.ModifierKeys.Control.ToString()); comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Items.Add(AutoScreenCapture.ModifierKeys.Shift.ToString()); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Items.Clear(); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Items.Add(AutoScreenCapture.ModifierKeys.Alt.ToString()); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Items.Add(AutoScreenCapture.ModifierKeys.Control.ToString()); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Items.Add(AutoScreenCapture.ModifierKeys.Shift.ToString()); + + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Items.Clear(); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Items.Add(AutoScreenCapture.ModifierKeys.Alt.ToString()); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Items.Add(AutoScreenCapture.ModifierKeys.Control.ToString()); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Items.Add(AutoScreenCapture.ModifierKeys.Shift.ToString()); + // Map the modifier key enum value from the provided user setting to the combo box control's selected index. comboBoxKeyboardShortcutStartScreenCaptureModifier1.SelectedIndex = MapModifierKeyFromUserSetting(comboBoxKeyboardShortcutStartScreenCaptureModifier1, Settings.User.GetByKey("StringKeyboardShortcutStartScreenCaptureModifier1", DefaultSettings.StringKeyboardShortcutStartScreenCaptureModifier1).Value.ToString()); comboBoxKeyboardShortcutStartScreenCaptureModifier2.SelectedIndex = MapModifierKeyFromUserSetting(comboBoxKeyboardShortcutStartScreenCaptureModifier2, Settings.User.GetByKey("StringKeyboardShortcutStartScreenCaptureModifier2", DefaultSettings.StringKeyboardShortcutStartScreenCaptureModifier2).Value.ToString()); @@ -109,12 +119,15 @@ private void FormKeyboardShortcuts_Load(object sender, EventArgs e) comboBoxKeyboardShortcutCaptureNowEditModifier2.SelectedIndex = MapModifierKeyFromUserSetting(comboBoxKeyboardShortcutCaptureNowEditModifier2, Settings.User.GetByKey("StringKeyboardShortcutCaptureNowEditModifier2", DefaultSettings.StringKeyboardShortcutCaptureNowEditModifier2).Value.ToString()); comboBoxKeyboardShortcutRegionSelectClipboardModifier1.SelectedIndex = MapModifierKeyFromUserSetting(comboBoxKeyboardShortcutRegionSelectClipboardModifier1, Settings.User.GetByKey("StringKeyboardShortcutRegionSelectClipboardModifier1", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardModifier1).Value.ToString()); comboBoxKeyboardShortcutRegionSelectClipboardModifier2.SelectedIndex = MapModifierKeyFromUserSetting(comboBoxKeyboardShortcutRegionSelectClipboardModifier2, Settings.User.GetByKey("StringKeyboardShortcutRegionSelectClipboardModifier2", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardModifier2).Value.ToString()); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.SelectedIndex = MapModifierKeyFromUserSetting(comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1, Settings.User.GetByKey("StringKeyboardShortcutRegionSelectAutoSaveModifier1", DefaultSettings.StringKeyboardShortcutRegionSelectAutoSaveModifier1).Value.ToString()); + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.SelectedIndex = MapModifierKeyFromUserSetting(comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2, Settings.User.GetByKey("StringKeyboardShortcutRegionSelectAutoSaveModifier2", DefaultSettings.StringKeyboardShortcutRegionSelectAutoSaveModifier2).Value.ToString()); textBoxKeyboardShortcutStartScreenCaptureKey.Text = Settings.User.GetByKey("StringKeyboardShortcutStartScreenCaptureKey", DefaultSettings.StringKeyboardShortcutStartScreenCaptureKey).Value.ToString().ToUpper(); textBoxKeyboardShortcutStopScreenCaptureKey.Text = Settings.User.GetByKey("StringKeyboardShortcutStopScreenCaptureKey", DefaultSettings.StringKeyboardShortcutStopScreenCaptureKey).Value.ToString().ToUpper(); textBoxKeyboardShortcutCaptureNowArchiveKey.Text = Settings.User.GetByKey("StringKeyboardShortcutCaptureNowArchiveKey", DefaultSettings.StringKeyboardShortcutCaptureNowArchiveKey).Value.ToString().ToUpper(); textBoxKeyboardShortcutCaptureNowEditKey.Text = Settings.User.GetByKey("StringKeyboardShortcutCaptureNowEditKey", DefaultSettings.StringKeyboardShortcutCaptureNowEditKey).Value.ToString().ToUpper(); textBoxKeyboardShortcutRegionSelectClipboardKey.Text = Settings.User.GetByKey("StringKeyboardShortcutRegionSelectClipboardKey", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardKey).Value.ToString().ToUpper(); + textBoxKeyboardShortcutRegionSelectAutoSaveKey.Text = Settings.User.GetByKey("StringKeyboardShortcutRegionSelectAutoSaveKey", DefaultSettings.StringKeyboardShortcutRegionSelectAutoSaveKey).Value.ToString().ToUpper(); } private int MapModifierKeyFromUserSetting(ComboBox comboBox, string userSetting) @@ -162,23 +175,29 @@ private void checkBoxUseKeyboardShortcuts_CheckedChanged(object sender, EventArg comboBoxKeyboardShortcutStopScreenCaptureModifier2.Enabled = true; textBoxKeyboardShortcutStopScreenCaptureKey.Enabled = true; - // Capture Now -> Archive + // Capture Now / Archive labelCaptureNowArchive.Enabled = true; comboBoxKeyboardShortcutCaptureNowArchiveModifier1.Enabled = true; comboBoxKeyboardShortcutCaptureNowArchiveModifier2.Enabled = true; textBoxKeyboardShortcutCaptureNowArchiveKey.Enabled = true; - // Capture Now -> Edit + // Capture Now / Edit labelCaptureNowEdit.Enabled = true; comboBoxKeyboardShortcutCaptureNowEditModifier1.Enabled = true; comboBoxKeyboardShortcutCaptureNowEditModifier2.Enabled = true; textBoxKeyboardShortcutCaptureNowEditKey.Enabled = true; - // Region Select -> Clipboard + // Region Select / Clipboard labelRegionSelectClipboard.Enabled = true; comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Enabled = true; comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Enabled = true; textBoxKeyboardShortcutRegionSelectClipboardKey.Enabled = true; + + // Region Select / Auto Save + labelRegionSelectAutoSave.Enabled = true; + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Enabled = true; + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Enabled = true; + textBoxKeyboardShortcutRegionSelectAutoSaveKey.Enabled = true; } else { @@ -194,23 +213,29 @@ private void checkBoxUseKeyboardShortcuts_CheckedChanged(object sender, EventArg comboBoxKeyboardShortcutStopScreenCaptureModifier2.Enabled = false; textBoxKeyboardShortcutStopScreenCaptureKey.Enabled = false; - // Capture Now -> Archive + // Capture Now / Archive labelCaptureNowArchive.Enabled = false; comboBoxKeyboardShortcutCaptureNowArchiveModifier1.Enabled = false; comboBoxKeyboardShortcutCaptureNowArchiveModifier2.Enabled = false; textBoxKeyboardShortcutCaptureNowArchiveKey.Enabled = false; - // Capture Now -> Edit + // Capture Now / Edit labelCaptureNowEdit.Enabled = false; comboBoxKeyboardShortcutCaptureNowEditModifier1.Enabled = false; comboBoxKeyboardShortcutCaptureNowEditModifier2.Enabled = false; textBoxKeyboardShortcutCaptureNowEditKey.Enabled = false; - // Region Select -> Clipboard + // Region Select / Clipboard labelRegionSelectClipboard.Enabled = false; comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Enabled = false; comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Enabled = false; textBoxKeyboardShortcutRegionSelectClipboardKey.Enabled = false; + + // Region Select / Auto Save + labelRegionSelectAutoSave.Enabled = false; + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Enabled = false; + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Enabled = false; + textBoxKeyboardShortcutRegionSelectAutoSaveKey.Enabled = false; } } @@ -220,7 +245,8 @@ private void buttonOK_Click(object sender, EventArgs e) comboBoxKeyboardShortcutStopScreenCaptureModifier1.Text.Equals(comboBoxKeyboardShortcutStopScreenCaptureModifier2.Text) || comboBoxKeyboardShortcutCaptureNowArchiveModifier1.Text.Equals(comboBoxKeyboardShortcutCaptureNowArchiveModifier2.Text) || comboBoxKeyboardShortcutCaptureNowEditModifier1.Text.Equals(comboBoxKeyboardShortcutCaptureNowEditModifier2.Text) || - comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Text.Equals(comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Text)) + comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Text.Equals(comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Text) || + comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Text.Equals(comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Text)) { MessageBox.Show("The first and second modifier keys (such as Alt, Control, and Shift) cannot equal each other.", "Equal Modifier Keys", MessageBoxButtons.OK, MessageBoxIcon.Warning); } @@ -238,12 +264,15 @@ private void buttonOK_Click(object sender, EventArgs e) Settings.User.SetValueByKey("StringKeyboardShortcutCaptureNowEditModifier2", comboBoxKeyboardShortcutCaptureNowEditModifier2.Text.ToString()); Settings.User.SetValueByKey("StringKeyboardShortcutRegionSelectClipboardModifier1", comboBoxKeyboardShortcutRegionSelectClipboardModifier1.Text.ToString()); Settings.User.SetValueByKey("StringKeyboardShortcutRegionSelectClipboardModifier2", comboBoxKeyboardShortcutRegionSelectClipboardModifier2.Text.ToString()); + Settings.User.SetValueByKey("StringKeyboardShortcutRegionSelectAutoSaveModifier1", comboBoxKeyboardShortcutRegionSelectAutoSaveModifier1.Text.ToString()); + Settings.User.SetValueByKey("StringKeyboardShortcutRegionSelectAutoSaveModifier2", comboBoxKeyboardShortcutRegionSelectAutoSaveModifier2.Text.ToString()); Settings.User.SetValueByKey("StringKeyboardShortcutStartScreenCaptureKey", textBoxKeyboardShortcutStartScreenCaptureKey.Text.ToString().ToUpper()); Settings.User.SetValueByKey("StringKeyboardShortcutStopScreenCaptureKey", textBoxKeyboardShortcutStopScreenCaptureKey.Text.ToString().ToUpper()); Settings.User.SetValueByKey("StringKeyboardShortcutCaptureNowArchiveKey", textBoxKeyboardShortcutCaptureNowArchiveKey.Text.ToString().ToUpper()); Settings.User.SetValueByKey("StringKeyboardShortcutCaptureNowEditKey", textBoxKeyboardShortcutCaptureNowEditKey.Text.ToString().ToUpper()); Settings.User.SetValueByKey("StringKeyboardShortcutRegionSelectClipboardKey", textBoxKeyboardShortcutRegionSelectClipboardKey.Text.ToString().ToUpper()); + Settings.User.SetValueByKey("StringKeyboardShortcutRegionSelectAutoSaveKey", textBoxKeyboardShortcutRegionSelectAutoSaveKey.Text.ToString().ToUpper()); Settings.User.Save(); diff --git a/interface/FormRegionSelectWithMouse.cs b/interface/FormRegionSelectWithMouse.cs index b94aac20..f4608e3d 100644 --- a/interface/FormRegionSelectWithMouse.cs +++ b/interface/FormRegionSelectWithMouse.cs @@ -48,6 +48,11 @@ public partial class FormRegionSelectWithMouse : Form public FormRegionSelectWithMouse() { InitializeComponent(); + + outputX = 0; + outputY = 0; + outputWidth = 0; + outputHeight = 0; } /// @@ -55,6 +60,16 @@ public FormRegionSelectWithMouse() /// private int _outputMode { get; set; } + /// + /// An event handler for handling when the mouse selection has completed for the mouse-driven region capture. + /// + public event EventHandler MouseSelectionCompleted; + + private void CompleteMouseSelection(object sender, EventArgs e) + { + MouseSelectionCompleted?.Invoke(sender, e); + } + /// /// Laods the canvas with the chosen output mode. /// @@ -139,16 +154,30 @@ private void pictureBoxMouseCanvas_MouseUp(object sender, MouseEventArgs e) pictureBoxMouseCanvas.CreateGraphics().DrawRectangle(_selectPen, _selectX, _selectY, _selectWidth, _selectHeight); } + Bitmap bitmap = null; + switch (_outputMode) { case 0: - outputX = _selectX; - outputY = _selectY; - outputWidth = _selectWidth; - outputHeight = _selectHeight; + bitmap = SelectBitmap(); + + if (bitmap != null) + { + outputX = _selectX; + outputY = _selectY; + outputWidth = _selectWidth; + outputHeight = _selectHeight; + + CompleteMouseSelection(sender, e); + } break; case 1: - SaveToClipboard(); + bitmap = SelectBitmap(); + + if (bitmap != null) + { + SaveToClipboard(bitmap); + } break; } @@ -157,7 +186,7 @@ private void pictureBoxMouseCanvas_MouseUp(object sender, MouseEventArgs e) Close(); } - private void SaveToClipboard() + private Bitmap SelectBitmap() { if (_selectWidth > 0) { @@ -173,7 +202,17 @@ private void SaveToClipboard() g.CompositingQuality = CompositingQuality.HighQuality; g.DrawImage(bitmap, 0, 0, rect, GraphicsUnit.Pixel); - Clipboard.SetImage(img); + return img; + } + + return null; + } + + private void SaveToClipboard(Bitmap bitmap) + { + if (bitmap != null) + { + Clipboard.SetImage(bitmap); } } } diff --git a/interface/main/FormMain-KeyboardShortcuts.cs b/interface/main/FormMain-KeyboardShortcuts.cs index 83f3dca8..c4207e41 100644 --- a/interface/main/FormMain-KeyboardShortcuts.cs +++ b/interface/main/FormMain-KeyboardShortcuts.cs @@ -73,17 +73,25 @@ private void RegisterKeyboardShortcuts() AutoScreenCapture.ModifierKeys keyboardShortcutRegionSelectClipboardModifier1 = GetModifierKeyFromUserSetting(keyboardShortcutRegionSelectClipboardModifier1UserSetting); AutoScreenCapture.ModifierKeys keyboardShortcutRegionSelectClipboardModifier2 = GetModifierKeyFromUserSetting(keyboardShortcutRegionSelectClipboardModifier2UserSetting); + string keyboardShortcutRegionSelectAutoSaveModifier1UserSetting = Settings.User.GetByKey("StringKeyboardShortcutRegionSelectAutoSaveModifier1", DefaultSettings.StringKeyboardShortcutRegionSelectAutoSaveModifier1).Value.ToString(); + string keyboardShortcutRegionSelectAutoSaveModifier2UserSetting = Settings.User.GetByKey("StringKeyboardShortcutRegionSelectAutoSaveModifier2", DefaultSettings.StringKeyboardShortcutRegionSelectAutoSaveModifier2).Value.ToString(); + _keyboardShortcutRegionSelectAutoSaveKeyUserSetting = Settings.User.GetByKey("StringKeyboardShortcutRegionSelectAutoSaveKey", DefaultSettings.StringKeyboardShortcutRegionSelectAutoSaveKey).Value.ToString(); + AutoScreenCapture.ModifierKeys keyboardShortcutRegionSelectAutoSaveModifier1 = GetModifierKeyFromUserSetting(keyboardShortcutRegionSelectAutoSaveModifier1UserSetting); + AutoScreenCapture.ModifierKeys keyboardShortcutRegionSelectAutoSaveModifier2 = GetModifierKeyFromUserSetting(keyboardShortcutRegionSelectAutoSaveModifier2UserSetting); + _hotKeyMap.RegisterHotKey(keyboardShortcutStartScreenCaptureModifier1 | keyboardShortcutStartScreenCaptureModifier2, GetKeyFromUserSetting(_keyboardShortcutStartScreenCaptureKeyUserSetting)); _hotKeyMap.RegisterHotKey(keyboardShortcutStopScreenCaptureModifier1 | keyboardShortcutStartScreenCaptureModifier2, GetKeyFromUserSetting(_keyboardShortcutStopScreenCaptureKeyUserSetting)); _hotKeyMap.RegisterHotKey(keyboardShortcutCaptureNowArchiveModifier1 | keyboardShortcutCaptureNowArchiveModifier2, GetKeyFromUserSetting(_keyboardShortcutCaptureNowArchiveKeyUserSetting)); _hotKeyMap.RegisterHotKey(keyboardShortcutCaptureNowEditModifier1 | keyboardShortcutCaptureNowEditModifier2, GetKeyFromUserSetting(_keyboardShortcutCaptureNowEditKeyUserSetting)); _hotKeyMap.RegisterHotKey(keyboardShortcutRegionSelectClipboardModifier1 | keyboardShortcutRegionSelectClipboardModifier2, GetKeyFromUserSetting(_keyboardShortcutRegionSelectClipboardKeyUserSetting)); + _hotKeyMap.RegisterHotKey(keyboardShortcutRegionSelectAutoSaveModifier1 | keyboardShortcutRegionSelectAutoSaveModifier2, GetKeyFromUserSetting(_keyboardShortcutRegionSelectAutoSaveKeyUserSetting)); toolStripMenuItemStartScreenCapture.ShortcutKeys = GetKeysFromUserSettings(keyboardShortcutStartScreenCaptureModifier1UserSetting, keyboardShortcutStartScreenCaptureModifier2UserSetting, _keyboardShortcutStartScreenCaptureKeyUserSetting); toolStripMenuItemStopScreenCapture.ShortcutKeys = GetKeysFromUserSettings(keyboardShortcutStopScreenCaptureModifier1UserSetting, keyboardShortcutStopScreenCaptureModifier2UserSetting, _keyboardShortcutStopScreenCaptureKeyUserSetting); toolStripMenuItemCaptureNowArchive.ShortcutKeys = GetKeysFromUserSettings(keyboardShortcutCaptureNowArchiveModifier1UserSetting, keyboardShortcutCaptureNowArchiveModifier2UserSetting, _keyboardShortcutCaptureNowArchiveKeyUserSetting); toolStripMenuItemCaptureNowEdit.ShortcutKeys = GetKeysFromUserSettings(keyboardShortcutCaptureNowEditModifier1UserSetting, keyboardShortcutCaptureNowEditModifier2UserSetting, _keyboardShortcutCaptureNowEditKeyUserSetting); toolStripMenuItemRegionSelectClipboard.ShortcutKeys = GetKeysFromUserSettings(keyboardShortcutRegionSelectClipboardModifier1UserSetting, keyboardShortcutRegionSelectClipboardModifier2UserSetting, _keyboardShortcutRegionSelectClipboardKeyUserSetting); + toolStripMenuItemRegionSelectAutoSave.ShortcutKeys = GetKeysFromUserSettings(keyboardShortcutRegionSelectAutoSaveModifier1UserSetting, keyboardShortcutRegionSelectAutoSaveModifier2UserSetting, _keyboardShortcutRegionSelectAutoSaveKeyUserSetting); } else { @@ -165,6 +173,11 @@ private void hotKey_KeyPressed(object sender, KeyPressedEventArgs e) { toolStripMenuItemRegionSelectClipboard_Click(sender, e); } + + if (e.Key == GetKeyFromUserSetting(_keyboardShortcutRegionSelectAutoSaveKeyUserSetting)) + { + toolStripMenuItemRegionSelectAutoSave_Click(sender, e); + } } } } \ No newline at end of file diff --git a/interface/main/FormMain-ScreenCapture.cs b/interface/main/FormMain-ScreenCapture.cs index 050f62b3..1c959a03 100644 --- a/interface/main/FormMain-ScreenCapture.cs +++ b/interface/main/FormMain-ScreenCapture.cs @@ -19,13 +19,15 @@ // along with this program. If not, see . //----------------------------------------------------------------------- using System; +using System.Drawing; using System.Windows.Forms; -using AutoScreenCapture.Properties; namespace AutoScreenCapture { public partial class FormMain : Form { + private FormRegionSelectWithMouse _formRegionSelectWithMouse; + /// /// Returns the screen capture interval. This value will be used as the screen capture timer's interval property. /// @@ -405,10 +407,69 @@ private void toolStripMenuItemCaptureNowEdit_Click(object sender, EventArgs e) /// private void toolStripMenuItemRegionSelectClipboard_Click(object sender, EventArgs e) { - FormRegionSelectWithMouse _formRegionSelectWithMouse = new FormRegionSelectWithMouse(); + _formRegionSelectWithMouse = new FormRegionSelectWithMouse(); _formRegionSelectWithMouse.LoadCanvas(outputMode: 1); // 1 is for saving the captured image to the clipboard } + /// + /// Shows a mouse-driven region selection canvas so you can select a region and then auto-save the captured image. + /// + /// + /// + private void toolStripMenuItemRegionSelectAutoSave_Click(object sender, EventArgs e) + { + _formRegionSelectWithMouse = new FormRegionSelectWithMouse(); + _formRegionSelectWithMouse.MouseSelectionCompleted += _formRegionSelectWithMouse_MouseSelectionCompleted; + _formRegionSelectWithMouse.LoadCanvas(outputMode: 0); // 0 is for acquiring the dimensions and resolution + } + + private void _formRegionSelectWithMouse_MouseSelectionCompleted(object sender, EventArgs e) + { + int x = _formRegionSelectWithMouse.outputX + 1; + int y = _formRegionSelectWithMouse.outputY + 1; + int width = _formRegionSelectWithMouse.outputWidth - 2; + int height = _formRegionSelectWithMouse.outputHeight - 2; + + string autoSaveFolder = textBoxAutoSaveFolder.Text; + string autoSaveMacro = textBoxAutoSaveMacro.Text; + + ImageFormat imageFormat = new ImageFormat(ImageFormatSpec.NAME_JPEG, ImageFormatSpec.EXTENSION_JPEG); + + if (_screenCapture.GetScreenImages(-1, x, y, width, height, mouse: false, resolutionRatio: 100, out Bitmap bitmap)) + { + if (_screenCapture.SaveScreenshot( + path: FileSystem.CorrectScreenshotsFolderPath(MacroParser.ParseTags(config: false, autoSaveFolder, _formTag.TagCollection)) + MacroParser.ParseTags(preview: false, config: false, DateTime.Now.ToString(MacroParser.DateFormat), autoSaveMacro, -1, imageFormat, _screenCapture.ActiveWindowTitle, _formTag.TagCollection), + format: imageFormat, + component: -1, + screenshotType: ScreenshotType.Region, + jpegQuality: 100, + viewId: new Guid(), + bitmap: bitmap, + label: checkBoxScreenshotLabel.Checked ? comboBoxScreenshotLabel.Text : string.Empty, + windowTitle: _screenCapture.ActiveWindowTitle, + processName: _screenCapture.ActiveWindowProcessName, + screenshotCollection: _screenshotCollection + )) + { + ScreenshotTakenWithSuccess(); + } + else + { + ScreenshotTakenWithFailure(); + } + } + } + + private void buttonBrowseFolder_Click(object sender, EventArgs e) + { + FolderBrowserDialog browser = new FolderBrowserDialog(); + + if (browser.ShowDialog() == DialogResult.OK) + { + textBoxAutoSaveFolder.Text = browser.SelectedPath; + } + } + /// /// The timer for taking screenshots. /// diff --git a/interface/main/FormMain-Settings.cs b/interface/main/FormMain-Settings.cs index 1addbe4b..f735147e 100644 --- a/interface/main/FormMain-Settings.cs +++ b/interface/main/FormMain-Settings.cs @@ -197,6 +197,10 @@ private void LoadSettings() checkBoxActiveWindowTitle.Checked = Convert.ToBoolean(Settings.User.GetByKey("BoolActiveWindowTitleCaptureCheck", DefaultSettings.BoolActiveWindowTitleCaptureCheck).Value); textBoxActiveWindowTitle.Text = Settings.User.GetByKey("StringActiveWindowTitleCaptureText", DefaultSettings.StringActiveWindowTitleCaptureText).Value.ToString(); + // Region Select / Auto Save + textBoxAutoSaveFolder.Text = Settings.User.GetByKey("StringAutoSaveFolder", DefaultSettings.StringAutoSaveFolder).Value.ToString(); + textBoxAutoSaveMacro.Text = Settings.User.GetByKey("StringAutoSaveMacro", DefaultSettings.StringAutoSaveMacro).Value.ToString(); + EnableStartCapture(); CaptureLimitCheck(); @@ -231,6 +235,10 @@ private void SaveSettings() Settings.User.GetByKey("BoolActiveWindowTitleCaptureCheck", DefaultSettings.BoolActiveWindowTitleCaptureCheck).Value = checkBoxActiveWindowTitle.Checked; Settings.User.GetByKey("StringActiveWindowTitleCaptureText", DefaultSettings.StringActiveWindowTitleCaptureText).Value = textBoxActiveWindowTitle.Text.Trim(); + // Region Select / Auto Save. + Settings.User.GetByKey("StringAutoSaveFolder", DefaultSettings.StringAutoSaveFolder).Value = textBoxAutoSaveFolder.Text.Trim(); + Settings.User.GetByKey("StringAutoSaveMacro", DefaultSettings.StringAutoSaveMacro).Value = textBoxAutoSaveMacro.Text.Trim(); + if (!Settings.User.Save()) { _screenCapture.ApplicationError = true; diff --git a/interface/main/FormMain.Designer.cs b/interface/main/FormMain.Designer.cs index 6ad08772..7beb68b3 100644 --- a/interface/main/FormMain.Designer.cs +++ b/interface/main/FormMain.Designer.cs @@ -53,6 +53,7 @@ private void InitializeComponent() this.toolStripMenuItemStopScreenCapture = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemCaptureNowArchive = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemCaptureNowEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItemRegionSelectAutoSave = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItemRegionSelectClipboard = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparatorCapture = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItemApplyLabel = new System.Windows.Forms.ToolStripMenuItem(); @@ -60,6 +61,12 @@ private void InitializeComponent() this.toolStripMenuItemExit = new System.Windows.Forms.ToolStripMenuItem(); this.tabControlModules = new System.Windows.Forms.TabControl(); this.tabPageSetup = new System.Windows.Forms.TabPage(); + this.groupBoxRegionSelectAutoSave = new System.Windows.Forms.GroupBox(); + this.buttonBrowseFolder = new System.Windows.Forms.Button(); + this.labelAutoSaveMacro = new System.Windows.Forms.Label(); + this.labelAutoSaveFolder = new System.Windows.Forms.Label(); + this.textBoxAutoSaveMacro = new System.Windows.Forms.TextBox(); + this.textBoxAutoSaveFolder = new System.Windows.Forms.TextBox(); this.groupBoxActiveWindowTitle = new System.Windows.Forms.GroupBox(); this.textBoxActiveWindowTitle = new System.Windows.Forms.TextBox(); this.checkBoxActiveWindowTitle = new System.Windows.Forms.CheckBox(); @@ -119,6 +126,7 @@ private void InitializeComponent() this.contextMenuStripSystemTrayIcon.SuspendLayout(); this.tabControlModules.SuspendLayout(); this.tabPageSetup.SuspendLayout(); + this.groupBoxRegionSelectAutoSave.SuspendLayout(); this.groupBoxActiveWindowTitle.SuspendLayout(); this.groupBoxSecurity.SuspendLayout(); this.groupBoxCaptureDelay.SuspendLayout(); @@ -272,12 +280,13 @@ private void InitializeComponent() this.toolStripMenuItemCaptureNowArchive, this.toolStripMenuItemCaptureNowEdit, this.toolStripMenuItemRegionSelectClipboard, + this.toolStripMenuItemRegionSelectAutoSave, this.toolStripSeparatorCapture, this.toolStripMenuItemApplyLabel, this.toolStripSeparatorApplyLabel, this.toolStripMenuItemExit}); this.contextMenuStripSystemTrayIcon.Name = "contextMenuStrip"; - this.contextMenuStripSystemTrayIcon.Size = new System.Drawing.Size(220, 270); + this.contextMenuStripSystemTrayIcon.Size = new System.Drawing.Size(220, 292); this.contextMenuStripSystemTrayIcon.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripSystemTrayIcon_Opening); // // toolStripMenuItemAbout @@ -334,7 +343,7 @@ private void InitializeComponent() this.toolStripMenuItemCaptureNowArchive.Image = global::AutoScreenCapture.Properties.Resources.capture_archive; this.toolStripMenuItemCaptureNowArchive.Name = "toolStripMenuItemCaptureNowArchive"; this.toolStripMenuItemCaptureNowArchive.Size = new System.Drawing.Size(219, 22); - this.toolStripMenuItemCaptureNowArchive.Text = "Capture Now -> Archive"; + this.toolStripMenuItemCaptureNowArchive.Text = "Capture Now / Archive"; this.toolStripMenuItemCaptureNowArchive.Click += new System.EventHandler(this.toolStripMenuItemCaptureNowArchive_Click); // // toolStripMenuItemCaptureNowEdit @@ -342,15 +351,23 @@ private void InitializeComponent() this.toolStripMenuItemCaptureNowEdit.Image = global::AutoScreenCapture.Properties.Resources.capture_edit; this.toolStripMenuItemCaptureNowEdit.Name = "toolStripMenuItemCaptureNowEdit"; this.toolStripMenuItemCaptureNowEdit.Size = new System.Drawing.Size(219, 22); - this.toolStripMenuItemCaptureNowEdit.Text = "Capture Now -> Edit"; + this.toolStripMenuItemCaptureNowEdit.Text = "Capture Now / Edit"; this.toolStripMenuItemCaptureNowEdit.Click += new System.EventHandler(this.toolStripMenuItemCaptureNowEdit_Click); // + // toolStripMenuItemRegionSelectAutoSave + // + this.toolStripMenuItemRegionSelectAutoSave.Image = global::AutoScreenCapture.Properties.Resources.region_select; + this.toolStripMenuItemRegionSelectAutoSave.Name = "toolStripMenuItemRegionSelectAutoSave"; + this.toolStripMenuItemRegionSelectAutoSave.Size = new System.Drawing.Size(219, 22); + this.toolStripMenuItemRegionSelectAutoSave.Text = "Region Select / Auto Save"; + this.toolStripMenuItemRegionSelectAutoSave.Click += new System.EventHandler(this.toolStripMenuItemRegionSelectAutoSave_Click); + // // toolStripMenuItemRegionSelectClipboard // this.toolStripMenuItemRegionSelectClipboard.Image = global::AutoScreenCapture.Properties.Resources.region_select; this.toolStripMenuItemRegionSelectClipboard.Name = "toolStripMenuItemRegionSelectClipboard"; this.toolStripMenuItemRegionSelectClipboard.Size = new System.Drawing.Size(219, 22); - this.toolStripMenuItemRegionSelectClipboard.Text = "Region Select -> Clipboard"; + this.toolStripMenuItemRegionSelectClipboard.Text = "Region Select / Clipboard"; this.toolStripMenuItemRegionSelectClipboard.Click += new System.EventHandler(this.toolStripMenuItemRegionSelectClipboard_Click); // // toolStripSeparatorCapture @@ -399,6 +416,7 @@ private void InitializeComponent() // tabPageSetup // this.tabPageSetup.AutoScroll = true; + this.tabPageSetup.Controls.Add(this.groupBoxRegionSelectAutoSave); this.tabPageSetup.Controls.Add(this.groupBoxActiveWindowTitle); this.tabPageSetup.Controls.Add(this.groupBoxSecurity); this.tabPageSetup.Controls.Add(this.checkBoxScreenshotLabel); @@ -412,6 +430,66 @@ private void InitializeComponent() this.tabPageSetup.Text = "Setup"; this.tabPageSetup.UseVisualStyleBackColor = true; // + // groupBoxRegionSelectAutoSave + // + this.groupBoxRegionSelectAutoSave.Controls.Add(this.buttonBrowseFolder); + this.groupBoxRegionSelectAutoSave.Controls.Add(this.labelAutoSaveMacro); + this.groupBoxRegionSelectAutoSave.Controls.Add(this.labelAutoSaveFolder); + this.groupBoxRegionSelectAutoSave.Controls.Add(this.textBoxAutoSaveMacro); + this.groupBoxRegionSelectAutoSave.Controls.Add(this.textBoxAutoSaveFolder); + this.groupBoxRegionSelectAutoSave.Location = new System.Drawing.Point(6, 256); + this.groupBoxRegionSelectAutoSave.Name = "groupBoxRegionSelectAutoSave"; + this.groupBoxRegionSelectAutoSave.Size = new System.Drawing.Size(205, 78); + this.groupBoxRegionSelectAutoSave.TabIndex = 0; + this.groupBoxRegionSelectAutoSave.TabStop = false; + this.groupBoxRegionSelectAutoSave.Text = "Region Select / Auto Save"; + // + // buttonBrowseFolder + // + this.buttonBrowseFolder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonBrowseFolder.Image = global::AutoScreenCapture.Properties.Resources.openfolder; + this.buttonBrowseFolder.Location = new System.Drawing.Point(172, 21); + this.buttonBrowseFolder.Name = "buttonBrowseFolder"; + this.buttonBrowseFolder.Size = new System.Drawing.Size(27, 23); + this.buttonBrowseFolder.TabIndex = 0; + this.buttonBrowseFolder.TabStop = false; + this.buttonBrowseFolder.UseVisualStyleBackColor = true; + this.buttonBrowseFolder.Click += new System.EventHandler(this.buttonBrowseFolder_Click); + // + // labelAutoSaveMacro + // + this.labelAutoSaveMacro.AutoSize = true; + this.labelAutoSaveMacro.Location = new System.Drawing.Point(3, 52); + this.labelAutoSaveMacro.Name = "labelAutoSaveMacro"; + this.labelAutoSaveMacro.Size = new System.Drawing.Size(40, 13); + this.labelAutoSaveMacro.TabIndex = 0; + this.labelAutoSaveMacro.Text = "Macro:"; + // + // labelAutoSaveFolder + // + this.labelAutoSaveFolder.AutoSize = true; + this.labelAutoSaveFolder.Location = new System.Drawing.Point(3, 26); + this.labelAutoSaveFolder.Name = "labelAutoSaveFolder"; + this.labelAutoSaveFolder.Size = new System.Drawing.Size(39, 13); + this.labelAutoSaveFolder.TabIndex = 0; + this.labelAutoSaveFolder.Text = "Folder:"; + // + // textBoxAutoSaveMacro + // + this.textBoxAutoSaveMacro.Location = new System.Drawing.Point(49, 49); + this.textBoxAutoSaveMacro.Name = "textBoxAutoSaveMacro"; + this.textBoxAutoSaveMacro.Size = new System.Drawing.Size(150, 20); + this.textBoxAutoSaveMacro.TabIndex = 0; + this.textBoxAutoSaveMacro.TabStop = false; + // + // textBoxAutoSaveFolder + // + this.textBoxAutoSaveFolder.Location = new System.Drawing.Point(49, 23); + this.textBoxAutoSaveFolder.Name = "textBoxAutoSaveFolder"; + this.textBoxAutoSaveFolder.Size = new System.Drawing.Size(117, 20); + this.textBoxAutoSaveFolder.TabIndex = 0; + this.textBoxAutoSaveFolder.TabStop = false; + // // groupBoxActiveWindowTitle // this.groupBoxActiveWindowTitle.Controls.Add(this.textBoxActiveWindowTitle); @@ -419,7 +497,7 @@ private void InitializeComponent() this.groupBoxActiveWindowTitle.Location = new System.Drawing.Point(6, 178); this.groupBoxActiveWindowTitle.Name = "groupBoxActiveWindowTitle"; this.groupBoxActiveWindowTitle.Size = new System.Drawing.Size(205, 72); - this.groupBoxActiveWindowTitle.TabIndex = 25; + this.groupBoxActiveWindowTitle.TabIndex = 0; this.groupBoxActiveWindowTitle.TabStop = false; this.groupBoxActiveWindowTitle.Text = "Active Window Title"; // @@ -430,7 +508,8 @@ private void InitializeComponent() this.textBoxActiveWindowTitle.MaxLength = 500; this.textBoxActiveWindowTitle.Name = "textBoxActiveWindowTitle"; this.textBoxActiveWindowTitle.Size = new System.Drawing.Size(193, 20); - this.textBoxActiveWindowTitle.TabIndex = 26; + this.textBoxActiveWindowTitle.TabIndex = 0; + this.textBoxActiveWindowTitle.TabStop = false; // // checkBoxActiveWindowTitle // @@ -438,7 +517,8 @@ private void InitializeComponent() this.checkBoxActiveWindowTitle.Location = new System.Drawing.Point(6, 19); this.checkBoxActiveWindowTitle.Name = "checkBoxActiveWindowTitle"; this.checkBoxActiveWindowTitle.Size = new System.Drawing.Size(185, 17); - this.checkBoxActiveWindowTitle.TabIndex = 25; + this.checkBoxActiveWindowTitle.TabIndex = 0; + this.checkBoxActiveWindowTitle.TabStop = false; this.checkBoxActiveWindowTitle.Text = "Capture only if the title contains ..."; this.checkBoxActiveWindowTitle.UseVisualStyleBackColor = true; this.checkBoxActiveWindowTitle.CheckedChanged += new System.EventHandler(this.checkBoxActiveWindowTitle_CheckedChanged); @@ -448,7 +528,7 @@ private void InitializeComponent() this.groupBoxSecurity.Controls.Add(this.labelPasswordDescription); this.groupBoxSecurity.Controls.Add(this.buttonSetPassphrase); this.groupBoxSecurity.Controls.Add(this.textBoxPassphrase); - this.groupBoxSecurity.Location = new System.Drawing.Point(6, 256); + this.groupBoxSecurity.Location = new System.Drawing.Point(6, 339); this.groupBoxSecurity.Name = "groupBoxSecurity"; this.groupBoxSecurity.Size = new System.Drawing.Size(205, 110); this.groupBoxSecurity.TabIndex = 0; @@ -494,6 +574,7 @@ private void InitializeComponent() this.checkBoxScreenshotLabel.Name = "checkBoxScreenshotLabel"; this.checkBoxScreenshotLabel.Size = new System.Drawing.Size(193, 17); this.checkBoxScreenshotLabel.TabIndex = 0; + this.checkBoxScreenshotLabel.TabStop = false; this.checkBoxScreenshotLabel.Text = "Apply this label to each screenshot:"; this.checkBoxScreenshotLabel.UseVisualStyleBackColor = true; this.checkBoxScreenshotLabel.MouseHover += new System.EventHandler(this.checkBoxScreenshotLabel_MouseHover); @@ -1071,6 +1152,8 @@ private void InitializeComponent() this.tabControlModules.ResumeLayout(false); this.tabPageSetup.ResumeLayout(false); this.tabPageSetup.PerformLayout(); + this.groupBoxRegionSelectAutoSave.ResumeLayout(false); + this.groupBoxRegionSelectAutoSave.PerformLayout(); this.groupBoxActiveWindowTitle.ResumeLayout(false); this.groupBoxActiveWindowTitle.PerformLayout(); this.groupBoxSecurity.ResumeLayout(false); @@ -1175,5 +1258,12 @@ private void InitializeComponent() private TextBox textBoxActiveWindowTitle; private CheckBox checkBoxActiveWindowTitle; private ToolStripMenuItem toolStripMenuItemRegionSelectClipboard; + private GroupBox groupBoxRegionSelectAutoSave; + private Label labelAutoSaveMacro; + private Label labelAutoSaveFolder; + private TextBox textBoxAutoSaveMacro; + private TextBox textBoxAutoSaveFolder; + private Button buttonBrowseFolder; + private ToolStripMenuItem toolStripMenuItemRegionSelectAutoSave; } } \ No newline at end of file diff --git a/interface/main/FormMain.cs b/interface/main/FormMain.cs index 8beee28e..7ad017db 100644 --- a/interface/main/FormMain.cs +++ b/interface/main/FormMain.cs @@ -53,6 +53,7 @@ public partial class FormMain : Form private string _keyboardShortcutCaptureNowArchiveKeyUserSetting; private string _keyboardShortcutCaptureNowEditKeyUserSetting; private string _keyboardShortcutRegionSelectClipboardKeyUserSetting; + private string _keyboardShortcutRegionSelectAutoSaveKeyUserSetting; private ScreenCapture _screenCapture; private ImageFormatCollection _imageFormatCollection; diff --git a/macro/MacroParser.cs b/macro/MacroParser.cs index d697b33a..bb73e136 100644 --- a/macro/MacroParser.cs +++ b/macro/MacroParser.cs @@ -156,6 +156,12 @@ public static string TimeFormatForWindows /// public static readonly string DefaultMacro = @"%date%\%name%\%date%_%time%.%format%"; + /// + /// The default folder and macro used for Region Select / Auto Save. + /// + public static readonly string DefaultAutoSaveFolder = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); + public static readonly string DefaultAutoSaveMacro = "Screen Shot %date% at %time%.%format%"; + /// /// Replaces a tag (such as "%year%") with an appropriate value (such as "2020"). /// diff --git a/readme.txt b/readme.txt index 07890c28..c922aed7 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,6 @@ Auto Screen Capture by Gavin Kendall -Last updated on 2020-07-29 (July 29, 2020) -[The information presented here refers to the latest version of the application (which is currently 2.3.1.4)] +Last updated on 2020-08-02 (August 2, 2020) +[The information presented here refers to the latest version of the application (which is currently 2.3.1.5)] ============================================================================================================= @@ -121,6 +121,12 @@ This menu will not be available if the session is locked. This is where to specify the text to compare against the active window title so that the application only takes screenshots if the active window title contains the defined text. +*Region Select / Auto Save* +This section defines the path of the folder and the filename pattern ("macro") for when +you right-click on the system tray icon and click on "Region Select / Auto Save" to +automatically save the captured region of the screen to an image file. By default this +saves a file to the user's desktop - much like doing Command+Shift+4 on a Mac. + *Security* You can set a passphrase in order to lock the running screen capture session once the application starts taking screenshots. diff --git a/settings/DefaultSettings.cs b/settings/DefaultSettings.cs index 2b2ada65..233c2560 100644 --- a/settings/DefaultSettings.cs +++ b/settings/DefaultSettings.cs @@ -93,6 +93,11 @@ public static class DefaultSettings internal static readonly string StringKeyboardShortcutRegionSelectClipboardModifier1 = "Control"; internal static readonly string StringKeyboardShortcutRegionSelectClipboardModifier2 = "Alt"; internal static readonly string StringKeyboardShortcutRegionSelectClipboardKey = "S"; + internal static readonly string StringAutoSaveFolder = MacroParser.DefaultAutoSaveFolder; + internal static readonly string StringAutoSaveMacro = MacroParser.DefaultAutoSaveMacro; + internal static readonly string StringKeyboardShortcutRegionSelectAutoSaveModifier1 = "Control"; + internal static readonly string StringKeyboardShortcutRegionSelectAutoSaveModifier2 = "Alt"; + internal static readonly string StringKeyboardShortcutRegionSelectAutoSaveKey = "Q"; // Old default user settings. internal static readonly bool BoolCaptureStartAt = false; diff --git a/settings/Settings.cs b/settings/Settings.cs index c4e2577d..5f38de0e 100644 --- a/settings/Settings.cs +++ b/settings/Settings.cs @@ -144,7 +144,8 @@ public static void Initialize() new Version(CODENAME_BOOMBAYAH, "2.3.1.0"), // Truncates long file paths. new Version(CODENAME_BOOMBAYAH, "2.3.1.1"), // ActiveWindowTitleLengthLimit application setting implemented. new Version(CODENAME_BOOMBAYAH, "2.3.1.2"), // Snagit Editor introduced as a new default image editor if available. - new Version(CODENAME_BOOMBAYAH, "2.3.1.3") // Fixed bug with new Editor throwing null reference exception on changing its properties because Notes was null. + new Version(CODENAME_BOOMBAYAH, "2.3.1.3"), // Fixed bug with new Editor throwing null reference exception on changing its properties because Notes was null. + new Version(CODENAME_BOOMBAYAH, "2.3.1.4") // ExitOnError set to True by default. }; Application = new SettingCollection @@ -356,6 +357,8 @@ public static void Initialize() User.Add(new Setting("StringKeyboardShortcutRegionSelectClipboardModifier1", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardModifier1)); User.Add(new Setting("StringKeyboardShortcutRegionSelectClipboardModifier2", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardModifier2)); User.Add(new Setting("StringKeyboardShortcutRegionSelectClipboardKey", DefaultSettings.StringKeyboardShortcutRegionSelectClipboardKey)); + User.Add(new Setting("StringAutoSaveFolder", DefaultSettings.StringAutoSaveFolder)); + User.Add(new Setting("StringAutoSaveMacro", DefaultSettings.StringAutoSaveMacro)); User.Save(); }