Added rectangle annotate options

This commit is contained in:
Jaex 2014-07-10 02:16:27 +03:00
parent f352149ed1
commit c0f4f26917
8 changed files with 170 additions and 69 deletions

View file

@ -37,7 +37,7 @@ namespace ScreenCaptureLib
{ {
public class RectangleAnnotate : Form public class RectangleAnnotate : Form
{ {
public static Rectangle LastSelectionRectangle0Based { get; set; } public static Rectangle LastSelectionRectangle0Based { get; private set; }
public Rectangle ScreenRectangle { get; private set; } public Rectangle ScreenRectangle { get; private set; }
@ -79,11 +79,6 @@ public Point PreviousMousePosition0Based
} }
} }
public bool ShowRectangleInfo { get; set; }
public bool ShowTips { get; set; }
public Color DrawingPenColor { get; set; }
public int DrawingPenSize { get; set; }
private bool cursorShown = true; private bool cursorShown = true;
public bool CursorShown public bool CursorShown
@ -112,17 +107,20 @@ private set
} }
} }
public RectangleAnnotateOptions Options;
private Timer timer; private Timer timer;
private Image backgroundImage; private Image backgroundImage;
private Pen borderDotPen, borderDotPen2; private Pen borderDotPen, borderDotPen2;
private Point positionOnClick; private Point positionOnClick;
private bool isMouseDown, isDrawingMode; private bool isMouseDown, isDrawingMode;
private Stopwatch penTimer; private Stopwatch penTimer;
private Font rectangleInfofont, tipFont; private Font rectangleInfofont, tipFont;
public RectangleAnnotate() public RectangleAnnotate(RectangleAnnotateOptions options)
{ {
Options = options;
backgroundImage = Screenshot.CaptureFullscreen(); backgroundImage = Screenshot.CaptureFullscreen();
borderDotPen = new Pen(Color.Black, 1); borderDotPen = new Pen(Color.Black, 1);
borderDotPen2 = new Pen(Color.White, 1); borderDotPen2 = new Pen(Color.White, 1);
@ -132,11 +130,6 @@ public RectangleAnnotate()
penTimer = Stopwatch.StartNew(); penTimer = Stopwatch.StartNew();
ScreenRectangle = CaptureHelpers.GetScreenBounds(); ScreenRectangle = CaptureHelpers.GetScreenBounds();
ShowRectangleInfo = true;
ShowTips = true;
DrawingPenColor = Color.FromArgb(0, 230, 0);
DrawingPenSize = 7;
InitializeComponent(); InitializeComponent();
using (MemoryStream cursorStream = new MemoryStream(Resources.Crosshair)) using (MemoryStream cursorStream = new MemoryStream(Resources.Crosshair))
@ -151,23 +144,6 @@ public RectangleAnnotate()
private IContainer components = null; private IContainer components = null;
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
if (timer != null) timer.Dispose();
if (backgroundImage != null) backgroundImage.Dispose();
if (borderDotPen != null) borderDotPen.Dispose();
if (borderDotPen2 != null) borderDotPen2.Dispose();
if (rectangleInfofont != null) rectangleInfofont.Dispose();
if (tipFont != null) tipFont.Dispose();
base.Dispose(disposing);
}
private void InitializeComponent() private void InitializeComponent()
{ {
SuspendLayout(); SuspendLayout();
@ -192,6 +168,23 @@ private void InitializeComponent()
ResumeLayout(false); ResumeLayout(false);
} }
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
if (timer != null) timer.Dispose();
if (backgroundImage != null) backgroundImage.Dispose();
if (borderDotPen != null) borderDotPen.Dispose();
if (borderDotPen2 != null) borderDotPen2.Dispose();
if (rectangleInfofont != null) rectangleInfofont.Dispose();
if (tipFont != null) tipFont.Dispose();
base.Dispose(disposing);
}
private void RectangleAnnotate_Shown(object sender, EventArgs e) private void RectangleAnnotate_Shown(object sender, EventArgs e)
{ {
this.ShowActivate(); this.ShowActivate();
@ -216,7 +209,7 @@ private void RectangleAnnotate_KeyDown(object sender, KeyEventArgs e)
try try
{ {
DrawingPenColor = DialogColor.GetColor(DrawingPenColor); Options.DrawingPenColor = DialogColor.GetColor(Options.DrawingPenColor);
} }
finally finally
{ {
@ -277,14 +270,14 @@ private void RectangleAnnotate_MouseWheel(object sender, MouseEventArgs e)
{ {
if (e.Delta > 0) if (e.Delta > 0)
{ {
DrawingPenSize++; Options.DrawingPenSize++;
} }
else if (e.Delta < 0) else if (e.Delta < 0)
{ {
DrawingPenSize--; Options.DrawingPenSize--;
} }
DrawingPenSize = DrawingPenSize.Between(1, 100); Options.DrawingPenSize = Options.DrawingPenSize.Between(1, 100);
} }
private void DoSelection(Rectangle rect) private void DoSelection(Rectangle rect)
@ -341,7 +334,7 @@ protected override void OnPaint(PaintEventArgs e)
using (Graphics gImage = Graphics.FromImage(backgroundImage)) using (Graphics gImage = Graphics.FromImage(backgroundImage))
{ {
gImage.SmoothingMode = SmoothingMode.HighQuality; gImage.SmoothingMode = SmoothingMode.HighQuality;
DrawLine(gImage, PreviousMousePosition0Based, CurrentMousePosition0Based, DrawingPenSize, DrawingPenColor); DrawLine(gImage, PreviousMousePosition0Based, CurrentMousePosition0Based, Options.DrawingPenSize, Options.DrawingPenColor);
} }
} }
@ -349,17 +342,17 @@ protected override void OnPaint(PaintEventArgs e)
if (isDrawingMode) if (isDrawingMode)
{ {
DrawDot(g, CurrentMousePosition0Based, DrawingPenSize, DrawingPenColor, true); DrawDot(g, CurrentMousePosition0Based, Options.DrawingPenSize, Options.DrawingPenColor, true);
} }
if (ShowTips) if (Options.ShowTips)
{ {
DrawTips(g); DrawTips(g);
} }
if (isMouseDown && !isDrawingMode) if (isMouseDown && !isDrawingMode)
{ {
if (ShowRectangleInfo) if (Options.ShowRectangleInfo)
{ {
DrawRectangleInfo(g); DrawRectangleInfo(g);
} }
@ -373,8 +366,8 @@ protected override void OnPaint(PaintEventArgs e)
private void DrawTips(Graphics g) private void DrawTips(Graphics g)
{ {
int offset = 10; int offset = 10;
int padding = 5; int padding = 2;
string tipText = "Ctrl: Drawing mode, Shift: Brush color, Mouse wheel: Brush size, Space: Fullscreen capture"; string tipText = "Ctrl: Drawing mode ░ Shift: Pen color ░ Mouse wheel: Pen size ░ Space: Fullscreen capture";
Size textSize = g.MeasureString(tipText, tipFont).ToSize(); Size textSize = g.MeasureString(tipText, tipFont).ToSize();
int rectWidth = textSize.Width + padding * 2; int rectWidth = textSize.Width + padding * 2;
int rectHeight = textSize.Height + padding * 2; int rectHeight = textSize.Height + padding * 2;

View file

@ -0,0 +1,55 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (C) 2007-2014 ShareX Developers
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using HelpersLib;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
namespace ScreenCaptureLib
{
public class RectangleAnnotateOptions
{
[DefaultValue(true), Description("Show position and size of selected rectangle area.")]
public bool ShowRectangleInfo { get; set; }
[DefaultValue(true), Description("Show hotkey tips.")]
public bool ShowTips { get; set; }
[DefaultValue(typeof(Color), "0, 230, 0"), Description("In drawing mode color of pen.")]
public Color DrawingPenColor { get; set; }
[DefaultValue(7), Description("In drawing mode size of pen.")]
public int DrawingPenSize { get; set; }
public RectangleAnnotateOptions()
{
this.ApplyDefaultPropertyValues();
}
}
}

View file

@ -57,6 +57,7 @@
<Compile Include="Forms\RectangleAnnotate.cs"> <Compile Include="Forms\RectangleAnnotate.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="RectangleAnnotateOptions.cs" />
<Compile Include="Screencast\AVIOptions.cs" /> <Compile Include="Screencast\AVIOptions.cs" />
<Compile Include="Screencast\FFmpegOptions.cs" /> <Compile Include="Screencast\FFmpegOptions.cs" />
<Compile Include="Screencast\FFmpegHelper.cs" /> <Compile Include="Screencast\FFmpegHelper.cs" />
@ -109,7 +110,7 @@
<Compile Include="RegionHelpers\NodeObject.cs" /> <Compile Include="RegionHelpers\NodeObject.cs" />
<Compile Include="RegionHelpers\ResizeManager.cs" /> <Compile Include="RegionHelpers\ResizeManager.cs" />
<Compile Include="RegionHelpers\ShapeCaptureHelpers.cs" /> <Compile Include="RegionHelpers\ShapeCaptureHelpers.cs" />
<Compile Include="RegionHelpers\SurfaceOptions.cs" /> <Compile Include="SurfaceOptions.cs" />
<Compile Include="Screencast\ScreenRecorder.cs" /> <Compile Include="Screencast\ScreenRecorder.cs" />
<Compile Include="Screencast\HardDiskCache.cs" /> <Compile Include="Screencast\HardDiskCache.cs" />
<Compile Include="Screencast\AVICache.cs" /> <Compile Include="Screencast\AVICache.cs" />

View file

@ -1630,7 +1630,7 @@ private void CaptureRectangleAnnotate(TaskSettings taskSettings = null, bool aut
{ {
Image img = null; Image img = null;
using (RectangleAnnotate rectangleAnnotate = new RectangleAnnotate()) using (RectangleAnnotate rectangleAnnotate = new RectangleAnnotate(taskSettings.TaskSettingsCaptureReference.RectangleAnnotateOptions))
{ {
if (rectangleAnnotate.ShowDialog() == DialogResult.OK) if (rectangleAnnotate.ShowDialog() == DialogResult.OK)
{ {

View file

@ -108,8 +108,8 @@ private void InitializeComponent()
this.cbCaptureShadow = new System.Windows.Forms.CheckBox(); this.cbCaptureShadow = new System.Windows.Forms.CheckBox();
this.cbShowCursor = new System.Windows.Forms.CheckBox(); this.cbShowCursor = new System.Windows.Forms.CheckBox();
this.cbCaptureTransparent = new System.Windows.Forms.CheckBox(); this.cbCaptureTransparent = new System.Windows.Forms.CheckBox();
this.tpCaptureShape = new System.Windows.Forms.TabPage(); this.tpRegionCapture = new System.Windows.Forms.TabPage();
this.pgShapesCapture = new System.Windows.Forms.PropertyGrid(); this.pgRegionCapture = new System.Windows.Forms.PropertyGrid();
this.tpScreenRecorder = new System.Windows.Forms.TabPage(); this.tpScreenRecorder = new System.Windows.Forms.TabPage();
this.cbScreenRecordAutoDisableAero = new System.Windows.Forms.CheckBox(); this.cbScreenRecordAutoDisableAero = new System.Windows.Forms.CheckBox();
this.lblScreenRecorderFixedDuration = new System.Windows.Forms.Label(); this.lblScreenRecorderFixedDuration = new System.Windows.Forms.Label();
@ -169,6 +169,8 @@ private void InitializeComponent()
this.tpAdvanced = new System.Windows.Forms.TabPage(); this.tpAdvanced = new System.Windows.Forms.TabPage();
this.pgTaskSettings = new System.Windows.Forms.PropertyGrid(); this.pgTaskSettings = new System.Windows.Forms.PropertyGrid();
this.chkUseDefaultAdvancedSettings = new System.Windows.Forms.CheckBox(); this.chkUseDefaultAdvancedSettings = new System.Windows.Forms.CheckBox();
this.tpRectangleAnnotate = new System.Windows.Forms.TabPage();
this.pgRectangleAnnotate = new System.Windows.Forms.PropertyGrid();
this.tcHotkeySettings.SuspendLayout(); this.tcHotkeySettings.SuspendLayout();
this.tpTask.SuspendLayout(); this.tpTask.SuspendLayout();
this.cmsDestinations.SuspendLayout(); this.cmsDestinations.SuspendLayout();
@ -189,7 +191,7 @@ private void InitializeComponent()
this.tpCaptureGeneral.SuspendLayout(); this.tpCaptureGeneral.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudScreenshotDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudScreenshotDelay)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudCaptureShadowOffset)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudCaptureShadowOffset)).BeginInit();
this.tpCaptureShape.SuspendLayout(); this.tpRegionCapture.SuspendLayout();
this.tpScreenRecorder.SuspendLayout(); this.tpScreenRecorder.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudScreenRecordFPS)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudScreenRecordFPS)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudScreenRecorderDuration)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudScreenRecorderDuration)).BeginInit();
@ -204,6 +206,7 @@ private void InitializeComponent()
this.tpUploadClipboard.SuspendLayout(); this.tpUploadClipboard.SuspendLayout();
this.tpIndexer.SuspendLayout(); this.tpIndexer.SuspendLayout();
this.tpAdvanced.SuspendLayout(); this.tpAdvanced.SuspendLayout();
this.tpRectangleAnnotate.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// cmsAfterCapture // cmsAfterCapture
@ -973,7 +976,8 @@ private void InitializeComponent()
// tcCapture // tcCapture
// //
this.tcCapture.Controls.Add(this.tpCaptureGeneral); this.tcCapture.Controls.Add(this.tpCaptureGeneral);
this.tcCapture.Controls.Add(this.tpCaptureShape); this.tcCapture.Controls.Add(this.tpRegionCapture);
this.tcCapture.Controls.Add(this.tpRectangleAnnotate);
this.tcCapture.Controls.Add(this.tpScreenRecorder); this.tcCapture.Controls.Add(this.tpScreenRecorder);
this.tcCapture.Dock = System.Windows.Forms.DockStyle.Fill; this.tcCapture.Dock = System.Windows.Forms.DockStyle.Fill;
this.tcCapture.Location = new System.Drawing.Point(3, 30); this.tcCapture.Location = new System.Drawing.Point(3, 30);
@ -1115,26 +1119,26 @@ private void InitializeComponent()
this.cbCaptureTransparent.UseVisualStyleBackColor = true; this.cbCaptureTransparent.UseVisualStyleBackColor = true;
this.cbCaptureTransparent.CheckedChanged += new System.EventHandler(this.cbCaptureTransparent_CheckedChanged); this.cbCaptureTransparent.CheckedChanged += new System.EventHandler(this.cbCaptureTransparent_CheckedChanged);
// //
// tpCaptureShape // tpRegionCapture
// //
this.tpCaptureShape.Controls.Add(this.pgShapesCapture); this.tpRegionCapture.Controls.Add(this.pgRegionCapture);
this.tpCaptureShape.Location = new System.Drawing.Point(4, 22); this.tpRegionCapture.Location = new System.Drawing.Point(4, 22);
this.tpCaptureShape.Name = "tpCaptureShape"; this.tpRegionCapture.Name = "tpRegionCapture";
this.tpCaptureShape.Padding = new System.Windows.Forms.Padding(3); this.tpRegionCapture.Padding = new System.Windows.Forms.Padding(3);
this.tpCaptureShape.Size = new System.Drawing.Size(509, 301); this.tpRegionCapture.Size = new System.Drawing.Size(509, 301);
this.tpCaptureShape.TabIndex = 1; this.tpRegionCapture.TabIndex = 1;
this.tpCaptureShape.Text = "Shape capture"; this.tpRegionCapture.Text = "Region capture";
this.tpCaptureShape.UseVisualStyleBackColor = true; this.tpRegionCapture.UseVisualStyleBackColor = true;
// //
// pgShapesCapture // pgRegionCapture
// //
this.pgShapesCapture.Dock = System.Windows.Forms.DockStyle.Fill; this.pgRegionCapture.Dock = System.Windows.Forms.DockStyle.Fill;
this.pgShapesCapture.Location = new System.Drawing.Point(3, 3); this.pgRegionCapture.Location = new System.Drawing.Point(3, 3);
this.pgShapesCapture.Name = "pgShapesCapture"; this.pgRegionCapture.Name = "pgRegionCapture";
this.pgShapesCapture.PropertySort = System.Windows.Forms.PropertySort.NoSort; this.pgRegionCapture.PropertySort = System.Windows.Forms.PropertySort.NoSort;
this.pgShapesCapture.Size = new System.Drawing.Size(503, 295); this.pgRegionCapture.Size = new System.Drawing.Size(503, 295);
this.pgShapesCapture.TabIndex = 0; this.pgRegionCapture.TabIndex = 0;
this.pgShapesCapture.ToolbarVisible = false; this.pgRegionCapture.ToolbarVisible = false;
// //
// tpScreenRecorder // tpScreenRecorder
// //
@ -1841,6 +1845,26 @@ private void InitializeComponent()
this.chkUseDefaultAdvancedSettings.UseVisualStyleBackColor = true; this.chkUseDefaultAdvancedSettings.UseVisualStyleBackColor = true;
this.chkUseDefaultAdvancedSettings.CheckedChanged += new System.EventHandler(this.chkUseDefaultAdvancedSettings_CheckedChanged); this.chkUseDefaultAdvancedSettings.CheckedChanged += new System.EventHandler(this.chkUseDefaultAdvancedSettings_CheckedChanged);
// //
// tpRectangleAnnotate
//
this.tpRectangleAnnotate.Controls.Add(this.pgRectangleAnnotate);
this.tpRectangleAnnotate.Location = new System.Drawing.Point(4, 22);
this.tpRectangleAnnotate.Name = "tpRectangleAnnotate";
this.tpRectangleAnnotate.Size = new System.Drawing.Size(509, 301);
this.tpRectangleAnnotate.TabIndex = 3;
this.tpRectangleAnnotate.Text = "Rectangle annotate";
this.tpRectangleAnnotate.UseVisualStyleBackColor = true;
//
// pgRectangleAnnotate
//
this.pgRectangleAnnotate.Dock = System.Windows.Forms.DockStyle.Fill;
this.pgRectangleAnnotate.Location = new System.Drawing.Point(0, 0);
this.pgRectangleAnnotate.Name = "pgRectangleAnnotate";
this.pgRectangleAnnotate.PropertySort = System.Windows.Forms.PropertySort.NoSort;
this.pgRectangleAnnotate.Size = new System.Drawing.Size(509, 301);
this.pgRectangleAnnotate.TabIndex = 1;
this.pgRectangleAnnotate.ToolbarVisible = false;
//
// TaskSettingsForm // TaskSettingsForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1884,7 +1908,7 @@ private void InitializeComponent()
this.tpCaptureGeneral.PerformLayout(); this.tpCaptureGeneral.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudScreenshotDelay)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudScreenshotDelay)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudCaptureShadowOffset)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudCaptureShadowOffset)).EndInit();
this.tpCaptureShape.ResumeLayout(false); this.tpRegionCapture.ResumeLayout(false);
this.tpScreenRecorder.ResumeLayout(false); this.tpScreenRecorder.ResumeLayout(false);
this.tpScreenRecorder.PerformLayout(); this.tpScreenRecorder.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudScreenRecordFPS)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudScreenRecordFPS)).EndInit();
@ -1907,6 +1931,7 @@ private void InitializeComponent()
this.tpIndexer.PerformLayout(); this.tpIndexer.PerformLayout();
this.tpAdvanced.ResumeLayout(false); this.tpAdvanced.ResumeLayout(false);
this.tpAdvanced.PerformLayout(); this.tpAdvanced.PerformLayout();
this.tpRectangleAnnotate.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
@ -1955,7 +1980,7 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox cbCaptureShadow; private System.Windows.Forms.CheckBox cbCaptureShadow;
private System.Windows.Forms.CheckBox cbShowCursor; private System.Windows.Forms.CheckBox cbShowCursor;
private System.Windows.Forms.CheckBox cbCaptureTransparent; private System.Windows.Forms.CheckBox cbCaptureTransparent;
private System.Windows.Forms.TabPage tpCaptureShape; private System.Windows.Forms.TabPage tpRegionCapture;
private System.Windows.Forms.TabPage tpScreenRecorder; private System.Windows.Forms.TabPage tpScreenRecorder;
private System.Windows.Forms.TabPage tpTask; private System.Windows.Forms.TabPage tpTask;
private System.Windows.Forms.TabPage tpActions; private System.Windows.Forms.TabPage tpActions;
@ -2009,7 +2034,7 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox chkShowAfterUploadForm; private System.Windows.Forms.CheckBox chkShowAfterUploadForm;
private System.Windows.Forms.CheckBox chkUseDefaultGeneralSettings; private System.Windows.Forms.CheckBox chkUseDefaultGeneralSettings;
private System.Windows.Forms.Panel panelGeneral; private System.Windows.Forms.Panel panelGeneral;
private System.Windows.Forms.PropertyGrid pgShapesCapture; private System.Windows.Forms.PropertyGrid pgRegionCapture;
private System.Windows.Forms.TabPage tpIndexer; private System.Windows.Forms.TabPage tpIndexer;
private System.Windows.Forms.PropertyGrid pgIndexerConfig; private System.Windows.Forms.PropertyGrid pgIndexerConfig;
private System.Windows.Forms.CheckBox chkUseDefaultIndexerSettings; private System.Windows.Forms.CheckBox chkUseDefaultIndexerSettings;
@ -2053,6 +2078,8 @@ private void InitializeComponent()
private System.Windows.Forms.Button btnDescriptionAutoFill; private System.Windows.Forms.Button btnDescriptionAutoFill;
private System.Windows.Forms.CheckBox cbScreenRecordAutoDisableAero; private System.Windows.Forms.CheckBox cbScreenRecordAutoDisableAero;
private System.Windows.Forms.CheckBox cbClipboardUploadShareURL; private System.Windows.Forms.CheckBox cbClipboardUploadShareURL;
private System.Windows.Forms.TabPage tpRectangleAnnotate;
private System.Windows.Forms.PropertyGrid pgRectangleAnnotate;

View file

@ -155,8 +155,13 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
nudScreenshotDelay.Value = TaskSettings.CaptureSettings.DelayScreenshot; nudScreenshotDelay.Value = TaskSettings.CaptureSettings.DelayScreenshot;
cbCaptureAutoHideTaskbar.Checked = TaskSettings.CaptureSettings.CaptureAutoHideTaskbar; cbCaptureAutoHideTaskbar.Checked = TaskSettings.CaptureSettings.CaptureAutoHideTaskbar;
// Capture / Region capture
if (TaskSettings.CaptureSettings.SurfaceOptions == null) TaskSettings.CaptureSettings.SurfaceOptions = new SurfaceOptions(); if (TaskSettings.CaptureSettings.SurfaceOptions == null) TaskSettings.CaptureSettings.SurfaceOptions = new SurfaceOptions();
pgShapesCapture.SelectedObject = TaskSettings.CaptureSettings.SurfaceOptions; pgRegionCapture.SelectedObject = TaskSettings.CaptureSettings.SurfaceOptions;
// Capture / Rectangle annotate
if (TaskSettings.CaptureSettings.RectangleAnnotateOptions == null) TaskSettings.CaptureSettings.RectangleAnnotateOptions = new RectangleAnnotateOptions();
pgRectangleAnnotate.SelectedObject = TaskSettings.CaptureSettings.RectangleAnnotateOptions;
// Capture / Screen recorder // Capture / Screen recorder
cbScreenRecorderOutput.Items.AddRange(Helpers.GetEnumDescriptions<ScreenRecordOutput>()); cbScreenRecorderOutput.Items.AddRange(Helpers.GetEnumDescriptions<ScreenRecordOutput>());

View file

@ -99,6 +99,20 @@ public string Description
[JsonIgnore] [JsonIgnore]
public TaskSettings TaskSettingsReference { get; private set; } public TaskSettings TaskSettingsReference { get; private set; }
[JsonIgnore]
public TaskSettingsCapture TaskSettingsCaptureReference
{
get
{
if (UseDefaultCaptureSettings)
{
return Program.DefaultTaskSettings.CaptureSettings;
}
return TaskSettingsReference.CaptureSettings;
}
}
public override string ToString() public override string ToString()
{ {
if (!string.IsNullOrEmpty(Description)) if (!string.IsNullOrEmpty(Description))
@ -286,11 +300,17 @@ public class TaskSettingsCapture
#endregion Capture / General #endregion Capture / General
#region Capture / Shape capture #region Capture / Region capture
public SurfaceOptions SurfaceOptions = new SurfaceOptions(); public SurfaceOptions SurfaceOptions = new SurfaceOptions();
#endregion Capture / Shape capture #endregion Capture / Region capture
#region Capture / Rectangle annotate
public RectangleAnnotateOptions RectangleAnnotateOptions = new RectangleAnnotateOptions();
#endregion Capture / Rectangle annotate
#region Capture / Screen recorder #region Capture / Screen recorder