diff --git a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs
index aaf7bbf73..09812b3f6 100644
--- a/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs
+++ b/ShareX.ScreenCaptureLib/Forms/RegionCaptureForm.cs
@@ -195,7 +195,16 @@ private void InitializeComponent()
if (IsFullscreen)
{
FormBorderStyle = FormBorderStyle.None;
- Bounds = CaptureHelpers.GetScreenBounds();
+
+ if (Options.ActiveMonitorMode)
+ {
+ Bounds = CaptureHelpers.GetActiveScreenBounds();
+ }
+ else
+ {
+ Bounds = CaptureHelpers.GetScreenBounds();
+ }
+
ShowInTaskbar = false;
#if !DEBUG
TopMost = true;
@@ -252,6 +261,7 @@ private void InitializeComponent()
Shown += RegionCaptureForm_Shown;
KeyDown += RegionCaptureForm_KeyDown;
MouseDown += RegionCaptureForm_MouseDown;
+ MouseEnter += RegionCaptureForm_MouseEnter;
MouseWheel += RegionCaptureForm_MouseWheel;
Resize += RegionCaptureForm_Resize;
LocationChanged += RegionCaptureForm_LocationChanged;
@@ -461,7 +471,7 @@ public void PanToOffset(Vector2 centerOffset)
if (IsEditorMode)
{
RectangleF canvas = CanvasRectangle.Scale(ZoomFactor);
- float x = (ClientArea.Width / 2) + centerOffset.X;
+ float x = (ClientArea.Width / 2) + centerOffset.X;
float y = (ClientArea.Height / 2) + centerOffset.Y;
float newX = x - (canvas.Width / 2);
float newY = y - (canvas.Height / 2);
@@ -677,6 +687,14 @@ private void RegionCaptureForm_MouseDown(object sender, MouseEventArgs e)
}
}
+ private void RegionCaptureForm_MouseEnter(object sender, EventArgs e)
+ {
+ if (IsFullscreen && Options.ActiveMonitorMode)
+ {
+ Cursor.Clip = Bounds;
+ }
+ }
+
private void RegionCaptureForm_MouseWheel(object sender, MouseEventArgs e)
{
if (IsEditorMode && ModifierKeys == Keys.Control)
@@ -732,7 +750,7 @@ private void Zoom(bool zoomIn, bool atMouse = true)
private void ZoomToFit()
{
- ZoomFactor = Math.Min(ClientArea.Width/CanvasRectangle.Width, (ClientArea.Height-ToolbarHeight)/CanvasRectangle.Height);
+ ZoomFactor = Math.Min(ClientArea.Width / CanvasRectangle.Width, (ClientArea.Height - ToolbarHeight) / CanvasRectangle.Height);
CenterCanvas();
}
diff --git a/ShareX.ScreenCaptureLib/RegionCaptureOptions.cs b/ShareX.ScreenCaptureLib/RegionCaptureOptions.cs
index 8ea0b5a11..f7c4cdbf6 100644
--- a/ShareX.ScreenCaptureLib/RegionCaptureOptions.cs
+++ b/ShareX.ScreenCaptureLib/RegionCaptureOptions.cs
@@ -78,9 +78,9 @@ public class RegionCaptureOptions
public bool MenuCollapsed = false;
public Point MenuPosition = Point.Empty;
public int InputDelay = 500;
-
public bool SwitchToDrawingToolAfterSelection = false;
public bool SwitchToSelectionToolAfterDrawing = false;
+ public bool ActiveMonitorMode = true;
// Annotation
public AnnotationOptions AnnotationOptions = new AnnotationOptions();
diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/TextOutlineDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/TextOutlineDrawingShape.cs
index acfdb5eec..3fcbcc420 100644
--- a/ShareX.ScreenCaptureLib/Shapes/Drawing/TextOutlineDrawingShape.cs
+++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/TextOutlineDrawingShape.cs
@@ -123,7 +123,7 @@ protected void DrawTextWithOutline(Graphics g, string text, TextDrawingOptions o
{
if (TextOptions.Gradient)
{
- textBrush = new LinearGradientBrush(System.Drawing.Rectangle.Round(pathRect).Offset(1), textColor, TextOptions.Color2, TextOptions.GradientMode);
+ textBrush = new LinearGradientBrush(pathRect.Round().Offset(1), textColor, TextOptions.Color2, TextOptions.GradientMode);
}
else
{
diff --git a/ShareX/Forms/TaskSettingsForm.Designer.cs b/ShareX/Forms/TaskSettingsForm.Designer.cs
index 7742cbc5a..c2d8b0674 100644
--- a/ShareX/Forms/TaskSettingsForm.Designer.cs
+++ b/ShareX/Forms/TaskSettingsForm.Designer.cs
@@ -157,6 +157,8 @@ private void InitializeComponent()
this.nudCaptureShadowOffset = new System.Windows.Forms.NumericUpDown();
this.cbOverrideCaptureSettings = new System.Windows.Forms.CheckBox();
this.tpRegionCapture = new System.Windows.Forms.TabPage();
+ this.nudRegionCaptureFPSLimit = new System.Windows.Forms.NumericUpDown();
+ this.lblRegionCaptureFPSLimit = new System.Windows.Forms.Label();
this.cbRegionCaptureShowFPS = new System.Windows.Forms.CheckBox();
this.flpRegionCaptureFixedSize = new System.Windows.Forms.FlowLayoutPanel();
this.lblRegionCaptureFixedSizeWidth = new System.Windows.Forms.Label();
@@ -295,8 +297,7 @@ private void InitializeComponent()
this.pgTaskSettings = new System.Windows.Forms.PropertyGrid();
this.cbOverrideAdvancedSettings = new System.Windows.Forms.CheckBox();
this.tttvMain = new ShareX.HelpersLib.TabToTreeView();
- this.lblRegionCaptureFPSLimit = new System.Windows.Forms.Label();
- this.nudRegionCaptureFPSLimit = new System.Windows.Forms.NumericUpDown();
+ this.cbRegionCaptureActiveMonitorMode = new System.Windows.Forms.CheckBox();
this.tcTaskSettings.SuspendLayout();
this.tpTask.SuspendLayout();
this.cmsDestinations.SuspendLayout();
@@ -330,6 +331,7 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.nudScreenshotDelay)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudCaptureShadowOffset)).BeginInit();
this.tpRegionCapture.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.nudRegionCaptureFPSLimit)).BeginInit();
this.flpRegionCaptureFixedSize.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudRegionCaptureFixedSizeWidth)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudRegionCaptureFixedSizeHeight)).BeginInit();
@@ -357,7 +359,6 @@ private void InitializeComponent()
this.tpTools.SuspendLayout();
this.pTools.SuspendLayout();
this.tpAdvanced.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.nudRegionCaptureFPSLimit)).BeginInit();
this.SuspendLayout();
//
// cmsAfterCapture
@@ -1408,6 +1409,7 @@ private void InitializeComponent()
// tpRegionCapture
//
this.tpRegionCapture.BackColor = System.Drawing.SystemColors.Window;
+ this.tpRegionCapture.Controls.Add(this.cbRegionCaptureActiveMonitorMode);
this.tpRegionCapture.Controls.Add(this.nudRegionCaptureFPSLimit);
this.tpRegionCapture.Controls.Add(this.lblRegionCaptureFPSLimit);
this.tpRegionCapture.Controls.Add(this.cbRegionCaptureShowFPS);
@@ -1443,6 +1445,22 @@ private void InitializeComponent()
resources.ApplyResources(this.tpRegionCapture, "tpRegionCapture");
this.tpRegionCapture.Name = "tpRegionCapture";
//
+ // nudRegionCaptureFPSLimit
+ //
+ resources.ApplyResources(this.nudRegionCaptureFPSLimit, "nudRegionCaptureFPSLimit");
+ this.nudRegionCaptureFPSLimit.Maximum = new decimal(new int[] {
+ 300,
+ 0,
+ 0,
+ 0});
+ this.nudRegionCaptureFPSLimit.Name = "nudRegionCaptureFPSLimit";
+ this.nudRegionCaptureFPSLimit.ValueChanged += new System.EventHandler(this.nudRegionCaptureFPSLimit_ValueChanged);
+ //
+ // lblRegionCaptureFPSLimit
+ //
+ resources.ApplyResources(this.lblRegionCaptureFPSLimit, "lblRegionCaptureFPSLimit");
+ this.lblRegionCaptureFPSLimit.Name = "lblRegionCaptureFPSLimit";
+ //
// cbRegionCaptureShowFPS
//
resources.ApplyResources(this.cbRegionCaptureShowFPS, "cbRegionCaptureShowFPS");
@@ -2567,21 +2585,12 @@ private void InitializeComponent()
this.tttvMain.TreeViewSize = 190;
this.tttvMain.TabChanged += new ShareX.HelpersLib.TabToTreeView.TabChangedEventHandler(this.tttvMain_TabChanged);
//
- // lblRegionCaptureFPSLimit
+ // cbRegionCaptureActiveMonitorMode
//
- resources.ApplyResources(this.lblRegionCaptureFPSLimit, "lblRegionCaptureFPSLimit");
- this.lblRegionCaptureFPSLimit.Name = "lblRegionCaptureFPSLimit";
- //
- // nudRegionCaptureFPSLimit
- //
- resources.ApplyResources(this.nudRegionCaptureFPSLimit, "nudRegionCaptureFPSLimit");
- this.nudRegionCaptureFPSLimit.Maximum = new decimal(new int[] {
- 300,
- 0,
- 0,
- 0});
- this.nudRegionCaptureFPSLimit.Name = "nudRegionCaptureFPSLimit";
- this.nudRegionCaptureFPSLimit.ValueChanged += new System.EventHandler(this.nudRegionCaptureFPSLimit_ValueChanged);
+ resources.ApplyResources(this.cbRegionCaptureActiveMonitorMode, "cbRegionCaptureActiveMonitorMode");
+ this.cbRegionCaptureActiveMonitorMode.Name = "cbRegionCaptureActiveMonitorMode";
+ this.cbRegionCaptureActiveMonitorMode.UseVisualStyleBackColor = true;
+ this.cbRegionCaptureActiveMonitorMode.CheckedChanged += new System.EventHandler(this.cbRegionCaptureActiveMonitorMode_CheckedChanged);
//
// TaskSettingsForm
//
@@ -2637,6 +2646,7 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.nudCaptureShadowOffset)).EndInit();
this.tpRegionCapture.ResumeLayout(false);
this.tpRegionCapture.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.nudRegionCaptureFPSLimit)).EndInit();
this.flpRegionCaptureFixedSize.ResumeLayout(false);
this.flpRegionCaptureFixedSize.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudRegionCaptureFixedSizeWidth)).EndInit();
@@ -2678,7 +2688,6 @@ private void InitializeComponent()
this.pTools.PerformLayout();
this.tpAdvanced.ResumeLayout(false);
this.tpAdvanced.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.nudRegionCaptureFPSLimit)).EndInit();
this.ResumeLayout(false);
}
@@ -2952,5 +2961,6 @@ private void InitializeComponent()
private System.Windows.Forms.CheckBox cbToastWindowAutoHide;
private System.Windows.Forms.NumericUpDown nudRegionCaptureFPSLimit;
private System.Windows.Forms.Label lblRegionCaptureFPSLimit;
+ private System.Windows.Forms.CheckBox cbRegionCaptureActiveMonitorMode;
}
}
\ No newline at end of file
diff --git a/ShareX/Forms/TaskSettingsForm.cs b/ShareX/Forms/TaskSettingsForm.cs
index 745a49ef8..609abd1dc 100644
--- a/ShareX/Forms/TaskSettingsForm.cs
+++ b/ShareX/Forms/TaskSettingsForm.cs
@@ -321,6 +321,7 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
nudRegionCaptureFixedSizeHeight.SetValue(TaskSettings.CaptureSettings.SurfaceOptions.FixedSize.Height);
cbRegionCaptureShowFPS.Checked = TaskSettings.CaptureSettings.SurfaceOptions.ShowFPS;
nudRegionCaptureFPSLimit.SetValue(TaskSettings.CaptureSettings.SurfaceOptions.FPSLimit);
+ cbRegionCaptureActiveMonitorMode.Checked = TaskSettings.CaptureSettings.SurfaceOptions.ActiveMonitorMode;
#endregion Region capture
@@ -1216,6 +1217,11 @@ private void nudRegionCaptureFPSLimit_ValueChanged(object sender, EventArgs e)
TaskSettings.CaptureSettings.SurfaceOptions.FPSLimit = (int)nudRegionCaptureFPSLimit.Value;
}
+ private void cbRegionCaptureActiveMonitorMode_CheckedChanged(object sender, EventArgs e)
+ {
+ TaskSettings.CaptureSettings.SurfaceOptions.ActiveMonitorMode = cbRegionCaptureActiveMonitorMode.Checked;
+ }
+
#endregion Region capture
#region Screen recorder
diff --git a/ShareX/Forms/TaskSettingsForm.resx b/ShareX/Forms/TaskSettingsForm.resx
index 0656af77e..d26e048b6 100644
--- a/ShareX/Forms/TaskSettingsForm.resx
+++ b/ShareX/Forms/TaskSettingsForm.resx
@@ -397,7 +397,7 @@
btnAfterCapture
- ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpTask
@@ -409,7 +409,7 @@
btnAfterUpload
- ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpTask
@@ -421,7 +421,7 @@
btnDestinations
- ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpTask
@@ -433,7 +433,7 @@
btnTask
- ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpTask
@@ -591,6 +591,33 @@
0
+
+ True
+
+
+ 8, 464
+
+
+ 351, 17
+
+
+ 33
+
+
+ Show region capture only in active monitor and restrict cursor inside it
+
+
+ cbRegionCaptureActiveMonitorMode
+
+
+ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tpRegionCapture
+
+
+ 0
+
312, 436
@@ -613,7 +640,7 @@
tpRegionCapture
- 0
+ 1
True
@@ -640,7 +667,7 @@
tpRegionCapture
- 1
+ 2
True
@@ -670,7 +697,7 @@
tpRegionCapture
- 2
+ 3
True
@@ -748,7 +775,7 @@
tpRegionCapture
- 3
+ 4
True
@@ -778,7 +805,7 @@
tpRegionCapture
- 4
+ 5
True
@@ -808,7 +835,7 @@
tpRegionCapture
- 5
+ 6
True
@@ -838,7 +865,7 @@
tpRegionCapture
- 6
+ 7
True
@@ -868,7 +895,7 @@
tpRegionCapture
- 7
+ 8
True
@@ -898,7 +925,7 @@
tpRegionCapture
- 8
+ 9
True
@@ -928,7 +955,7 @@
tpRegionCapture
- 9
+ 10
True
@@ -958,7 +985,7 @@
tpRegionCapture
- 10
+ 11
NoControl
@@ -985,7 +1012,7 @@
tpRegionCapture
- 11
+ 12
NoControl
@@ -1012,7 +1039,7 @@
tpRegionCapture
- 12
+ 13
312, 220
@@ -1033,7 +1060,7 @@
tpRegionCapture
- 13
+ 14
True
@@ -1063,7 +1090,7 @@
tpRegionCapture
- 14
+ 15
True
@@ -1093,7 +1120,7 @@
tpRegionCapture
- 15
+ 16
True
@@ -1123,7 +1150,7 @@
tpRegionCapture
- 16
+ 17
True
@@ -1153,7 +1180,7 @@
tpRegionCapture
- 17
+ 18
312, 100
@@ -1174,7 +1201,7 @@
tpRegionCapture
- 18
+ 19
True
@@ -1204,7 +1231,7 @@
tpRegionCapture
- 19
+ 20
312, 76
@@ -1225,7 +1252,7 @@
tpRegionCapture
- 20
+ 21
True
@@ -1255,7 +1282,7 @@
tpRegionCapture
- 21
+ 22
312, 52
@@ -1276,7 +1303,7 @@
tpRegionCapture
- 22
+ 23
True
@@ -1306,7 +1333,7 @@
tpRegionCapture
- 23
+ 24
312, 28
@@ -1327,7 +1354,7 @@
tpRegionCapture
- 24
+ 25
True
@@ -1357,7 +1384,7 @@
tpRegionCapture
- 25
+ 26
True
@@ -1387,7 +1414,7 @@
tpRegionCapture
- 26
+ 27
btnRegionCaptureSnapSizesDialogCancel
@@ -1483,7 +1510,7 @@
tpRegionCapture
- 27
+ 28
True
@@ -1513,7 +1540,7 @@
tpRegionCapture
- 28
+ 29
312, 198
@@ -1534,7 +1561,7 @@
tpRegionCapture
- 29
+ 30
312, 316
@@ -1558,7 +1585,7 @@
tpRegionCapture
- 30
+ 31
312, 340
@@ -1582,7 +1609,7 @@
tpRegionCapture
- 31
+ 32
4, 22
@@ -2071,7 +2098,7 @@
lvWatchFolderList
- ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpWatchFolders
@@ -2485,7 +2512,7 @@
btnAfterCapture
- ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpTask
@@ -2515,7 +2542,7 @@
btnAfterUpload
- ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpTask
@@ -2557,7 +2584,7 @@
btnDestinations
- ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpTask
@@ -2623,7 +2650,7 @@
btnTask
- ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpTask
@@ -8143,7 +8170,7 @@
lvUploaderFiltersList
- ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpUploaderFilters
@@ -8290,7 +8317,7 @@
lvUploaderFiltersList
- ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpUploaderFilters
@@ -8575,7 +8602,7 @@
lvActions
- ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
pActions
@@ -8764,7 +8791,7 @@
lvActions
- ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
pActions
@@ -8965,7 +8992,7 @@
lvWatchFolderList
- ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
tpWatchFolders
@@ -9409,7 +9436,7 @@
tttvMain
- ShareX.HelpersLib.TabToTreeView, ShareX.HelpersLib, Version=13.7.1.0, Culture=neutral, PublicKeyToken=null
+ ShareX.HelpersLib.TabToTreeView, ShareX.HelpersLib, Version=13.7.2.0, Culture=neutral, PublicKeyToken=null
$this