mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-04 04:06:05 +13:00
Task for capturing specific monitor
Task for capturing specific monitor region fixed #594
This commit is contained in:
parent
a2ee2eb019
commit
0d6d1a8ef9
14 changed files with 3265 additions and 3864 deletions
|
@ -62,7 +62,7 @@ public void WriteElapsedSeconds(string text = null)
|
||||||
|
|
||||||
public void WriteElapsedMilliseconds(string text = null)
|
public void WriteElapsedMilliseconds(string text = null)
|
||||||
{
|
{
|
||||||
Write(text, timer.ElapsedMilliseconds + " millisecond.");
|
Write(text, timer.ElapsedMilliseconds + " milliseconds.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
|
|
@ -29,6 +29,7 @@ You should have received a copy of the GNU General Public License
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Cache;
|
using System.Net.Cache;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace ShareX.HelpersLib
|
namespace ShareX.HelpersLib
|
||||||
{
|
{
|
||||||
|
@ -113,6 +114,26 @@ public string GetLatestDownloadURL()
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetDownloadCounts()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
List<GitHubRelease> releases = GetReleases();
|
||||||
|
|
||||||
|
if (releases != null)
|
||||||
|
{
|
||||||
|
foreach (GitHubRelease release in releases)
|
||||||
|
{
|
||||||
|
if (release.assets.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendFormat("{0} ({1}): {2}\r\n", release.name, DateTime.Parse(release.published_at), release.assets.Sum(x => x.download_count));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.ToString().Trim();
|
||||||
|
}
|
||||||
|
|
||||||
private string GetDownloadURL(GitHubRelease release)
|
private string GetDownloadURL(GitHubRelease release)
|
||||||
{
|
{
|
||||||
if (release.assets != null && release.assets.Count > 0)
|
if (release.assets != null && release.assets.Count > 0)
|
||||||
|
|
70
ShareX.ScreenCaptureLib/MonitorRegion.cs
Normal file
70
ShareX.ScreenCaptureLib/MonitorRegion.cs
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using ShareX.ScreenCaptureLib.Properties;
|
||||||
|
|
||||||
|
namespace ShareX.ScreenCaptureLib
|
||||||
|
{
|
||||||
|
public class MonitorRegion
|
||||||
|
{
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
[DefaultValue("Monitor1 X:0 Y:0 Height:0 Width:0"), Description("The default monitor name.")]
|
||||||
|
public string MonitorName { get; private set; }
|
||||||
|
|
||||||
|
[DefaultValue(0)]
|
||||||
|
public int X { get; private set; }
|
||||||
|
|
||||||
|
[DefaultValue(0)]
|
||||||
|
public int Y { get; private set; }
|
||||||
|
|
||||||
|
[DefaultValue(0)]
|
||||||
|
public int Height { get; private set; }
|
||||||
|
|
||||||
|
[DefaultValue(0)]
|
||||||
|
public int Width { get; private set; }
|
||||||
|
|
||||||
|
[DefaultValue(0)]
|
||||||
|
public Rectangle MonitorBounds { get; private set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
public MonitorRegion(Screen monitor, int monitorNumber)
|
||||||
|
{
|
||||||
|
SetBoundsFromTheScreenBounds(monitor);
|
||||||
|
CreateTheNameFromBoundsAndMonitorNumber(monitor.Bounds, monitorNumber);
|
||||||
|
MonitorBounds = monitor.Bounds;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region private Methods
|
||||||
|
|
||||||
|
private void SetBoundsFromTheScreenBounds(Screen screen)
|
||||||
|
{
|
||||||
|
X = screen.Bounds.X;
|
||||||
|
Y = screen.Bounds.Y;
|
||||||
|
Height = screen.Bounds.Height;
|
||||||
|
Width = screen.Bounds.Width;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateTheNameFromBoundsAndMonitorNumber(Rectangle monitorBounds, int monitorNumber)
|
||||||
|
{
|
||||||
|
MonitorName = String.Format(Resources.ScreenRegion_Name_Monitor_0___X__1__Y__2__Height__3__Width__4_, monitorNumber, X, Y, Height, Width);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region overrides Methods
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return MonitorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
42
ShareX.ScreenCaptureLib/MonitorRegionDefaultCreator.cs
Normal file
42
ShareX.ScreenCaptureLib/MonitorRegionDefaultCreator.cs
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
using System.Linq;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using ShareX.ScreenCaptureLib;
|
||||||
|
|
||||||
|
|
||||||
|
namespace ShareX.ScreenCaptureLib
|
||||||
|
{
|
||||||
|
public static class MonitorRegionDefaultCreator
|
||||||
|
{
|
||||||
|
private static readonly int firstMonitorNumber = 1;
|
||||||
|
private static int monitorCounter;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the list of screens available on this computer
|
||||||
|
/// </summary>
|
||||||
|
public static MonitorRegion[] AllMonitorsRegions
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
Screen[] screens = Screen.AllScreens;
|
||||||
|
monitorCounter = firstMonitorNumber;
|
||||||
|
|
||||||
|
return screens.Select(screen => new MonitorRegion(screen, monitorCounter++)).ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the screen region for the primary monitor.
|
||||||
|
/// </summary>
|
||||||
|
public static MonitorRegion DefaultMonitorRegion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
Screen defaultScreen = Screen.PrimaryScreen;
|
||||||
|
|
||||||
|
return new MonitorRegion(defaultScreen, firstMonitorNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:4.0.30319.34209
|
// Runtime Version:4.0.30319.34014
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
|
@ -201,6 +201,15 @@ internal static string RectangleTransparent_RectangleTransparent_Rectangle_captu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Monitor{0} (X:{1} Y:{2} Height:{3} Width:{4}.
|
||||||
|
/// </summary>
|
||||||
|
internal static string ScreenRegion_Name_Monitor_0___X__1__Y__2__Height__3__Width__4_ {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ScreenRegion_Name_Monitor_0___X__1__Y__2__Height__3__Width__4_", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Region capture.
|
/// Looks up a localized string similar to Region capture.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -170,4 +170,7 @@ X: {4}, Y: {5}</value>
|
||||||
<data name="RectangleTransparent_RectangleTransparent_Rectangle_capture_transparent" xml:space="preserve">
|
<data name="RectangleTransparent_RectangleTransparent_Rectangle_capture_transparent" xml:space="preserve">
|
||||||
<value>Rectangle capture transparent</value>
|
<value>Rectangle capture transparent</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ScreenRegion_Name_Monitor_0___X__1__Y__2__Height__3__Width__4_" xml:space="preserve">
|
||||||
|
<value>Monitor{0} (X:{1} Y:{2} Height:{3} Width:{4}</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -53,6 +53,8 @@
|
||||||
<Compile Include="Forms\RectangleTransparent.cs">
|
<Compile Include="Forms\RectangleTransparent.cs">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="MonitorRegion.cs" />
|
||||||
|
<Compile Include="MonitorRegionDefaultCreator.cs" />
|
||||||
<Compile Include="RectangleAnnotateOptions.cs" />
|
<Compile Include="RectangleAnnotateOptions.cs" />
|
||||||
<Compile Include="Screencast\FFmpegOptions.cs" />
|
<Compile Include="Screencast\FFmpegOptions.cs" />
|
||||||
<Compile Include="Screencast\FFmpegHelper.cs" />
|
<Compile Include="Screencast\FFmpegHelper.cs" />
|
||||||
|
@ -124,14 +126,25 @@
|
||||||
<Content Include="Resources\Crosshair.cur" />
|
<Content Include="Resources\Crosshair.cur" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Properties\Resources.de.resx" />
|
<EmbeddedResource Include="Properties\Resources.de.resx">
|
||||||
<EmbeddedResource Include="Properties\Resources.es.resx" />
|
<SubType>Designer</SubType>
|
||||||
<EmbeddedResource Include="Properties\Resources.fr.resx" />
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.hu.resx" />
|
<EmbeddedResource Include="Properties\Resources.es.resx">
|
||||||
<EmbeddedResource Include="Properties\Resources.ko-KR.resx" />
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.fr.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.hu.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Properties\Resources.ko-KR.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="Properties\Resources.tr.resx" />
|
<EmbeddedResource Include="Properties\Resources.tr.resx" />
|
||||||
<EmbeddedResource Include="Properties\Resources.zh-CN.resx" />
|
<EmbeddedResource Include="Properties\Resources.zh-CN.resx" />
|
||||||
|
|
|
@ -116,6 +116,7 @@ public enum CaptureType
|
||||||
ActiveMonitor,
|
ActiveMonitor,
|
||||||
Window,
|
Window,
|
||||||
ActiveWindow,
|
ActiveWindow,
|
||||||
|
CustomRegion,
|
||||||
RectangleWindow,
|
RectangleWindow,
|
||||||
Rectangle,
|
Rectangle,
|
||||||
RoundedRectangle,
|
RoundedRectangle,
|
||||||
|
@ -140,6 +141,7 @@ public enum HotkeyType // Localized
|
||||||
PrintScreen,
|
PrintScreen,
|
||||||
ActiveWindow,
|
ActiveWindow,
|
||||||
ActiveMonitor,
|
ActiveMonitor,
|
||||||
|
CustomRegion,
|
||||||
RectangleRegion,
|
RectangleRegion,
|
||||||
WindowRectangle,
|
WindowRectangle,
|
||||||
RectangleAnnotate,
|
RectangleAnnotate,
|
||||||
|
|
|
@ -1514,6 +1514,9 @@ private void ExecuteJob(TaskSettings taskSettings, HotkeyType job)
|
||||||
case HotkeyType.ActiveMonitor:
|
case HotkeyType.ActiveMonitor:
|
||||||
CaptureScreenshot(CaptureType.ActiveMonitor, safeTaskSettings, false);
|
CaptureScreenshot(CaptureType.ActiveMonitor, safeTaskSettings, false);
|
||||||
break;
|
break;
|
||||||
|
case HotkeyType.CustomRegion:
|
||||||
|
CaptureScreenshot(CaptureType.CustomRegion, safeTaskSettings, false);
|
||||||
|
break;
|
||||||
case HotkeyType.RectangleRegion:
|
case HotkeyType.RectangleRegion:
|
||||||
CaptureScreenshot(CaptureType.Rectangle, safeTaskSettings, false);
|
CaptureScreenshot(CaptureType.Rectangle, safeTaskSettings, false);
|
||||||
break;
|
break;
|
||||||
|
@ -1619,6 +1622,9 @@ public void CaptureScreenshot(CaptureType captureType, TaskSettings taskSettings
|
||||||
case CaptureType.ActiveMonitor:
|
case CaptureType.ActiveMonitor:
|
||||||
DoCapture(Screenshot.CaptureActiveMonitor, CaptureType.ActiveMonitor, taskSettings, autoHideForm);
|
DoCapture(Screenshot.CaptureActiveMonitor, CaptureType.ActiveMonitor, taskSettings, autoHideForm);
|
||||||
break;
|
break;
|
||||||
|
case CaptureType.CustomRegion:
|
||||||
|
CaptureCustomRegion(CaptureType.CustomRegion, taskSettings, autoHideForm);
|
||||||
|
break;
|
||||||
case CaptureType.Rectangle:
|
case CaptureType.Rectangle:
|
||||||
case CaptureType.RectangleWindow:
|
case CaptureType.RectangleWindow:
|
||||||
case CaptureType.RoundedRectangle:
|
case CaptureType.RoundedRectangle:
|
||||||
|
@ -1754,6 +1760,17 @@ private void CaptureActiveWindow(TaskSettings taskSettings, bool autoHideForm =
|
||||||
}, CaptureType.ActiveWindow, taskSettings, autoHideForm);
|
}, CaptureType.ActiveWindow, taskSettings, autoHideForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CaptureCustomRegion(CaptureType capture, TaskSettings taskSettings, bool autoHideForm)
|
||||||
|
{
|
||||||
|
DoCapture(() =>
|
||||||
|
{
|
||||||
|
Rectangle regionBounds = taskSettings.CaptureSettings.DefaultBounds;
|
||||||
|
Image img = Screenshot.CaptureRectangle(regionBounds);
|
||||||
|
|
||||||
|
return img;
|
||||||
|
}, capture, taskSettings, autoHideForm);
|
||||||
|
}
|
||||||
|
|
||||||
private void CaptureWindow(IntPtr handle, TaskSettings taskSettings = null, bool autoHideForm = true)
|
private void CaptureWindow(IntPtr handle, TaskSettings taskSettings = null, bool autoHideForm = true)
|
||||||
{
|
{
|
||||||
if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();
|
if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();
|
||||||
|
|
178
ShareX/Forms/TaskSettingsForm.Designer.cs
generated
178
ShareX/Forms/TaskSettingsForm.Designer.cs
generated
|
@ -102,6 +102,17 @@ private void InitializeComponent()
|
||||||
this.tcCapture = new System.Windows.Forms.TabControl();
|
this.tcCapture = new System.Windows.Forms.TabControl();
|
||||||
this.tpCaptureGeneral = new System.Windows.Forms.TabPage();
|
this.tpCaptureGeneral = new System.Windows.Forms.TabPage();
|
||||||
this.pCapture = new System.Windows.Forms.Panel();
|
this.pCapture = new System.Windows.Forms.Panel();
|
||||||
|
this.btnTransmitBoundsFromMonitorToCustomBounds = new System.Windows.Forms.Button();
|
||||||
|
this.lblWidth = new System.Windows.Forms.Label();
|
||||||
|
this.lblHeight = new System.Windows.Forms.Label();
|
||||||
|
this.lblY = new System.Windows.Forms.Label();
|
||||||
|
this.lblX = new System.Windows.Forms.Label();
|
||||||
|
this.nudScreenRegionHeight = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.nudScreenRegionWidth = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.nudScreenRegionY = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.nudScreenRegionX = new System.Windows.Forms.NumericUpDown();
|
||||||
|
this.lblSelectedMonitorForCustomRegion = new System.Windows.Forms.Label();
|
||||||
|
this.cboMonitors = new System.Windows.Forms.ComboBox();
|
||||||
this.cbShowCursor = new System.Windows.Forms.CheckBox();
|
this.cbShowCursor = new System.Windows.Forms.CheckBox();
|
||||||
this.lblCaptureShadowOffset = new System.Windows.Forms.Label();
|
this.lblCaptureShadowOffset = new System.Windows.Forms.Label();
|
||||||
this.cbCaptureTransparent = new System.Windows.Forms.CheckBox();
|
this.cbCaptureTransparent = new System.Windows.Forms.CheckBox();
|
||||||
|
@ -156,6 +167,8 @@ private void InitializeComponent()
|
||||||
this.tcUpload = new System.Windows.Forms.TabControl();
|
this.tcUpload = new System.Windows.Forms.TabControl();
|
||||||
this.tpUploadNamePattern = new System.Windows.Forms.TabPage();
|
this.tpUploadNamePattern = new System.Windows.Forms.TabPage();
|
||||||
this.pUpload = new System.Windows.Forms.Panel();
|
this.pUpload = new System.Windows.Forms.Panel();
|
||||||
|
this.cbNameFormatCustomTimeZone = new System.Windows.Forms.CheckBox();
|
||||||
|
this.cbNameFormatTimeZone = new System.Windows.Forms.ComboBox();
|
||||||
this.lblNameFormatPattern = new System.Windows.Forms.Label();
|
this.lblNameFormatPattern = new System.Windows.Forms.Label();
|
||||||
this.cbFileUploadUseNamePattern = new System.Windows.Forms.CheckBox();
|
this.cbFileUploadUseNamePattern = new System.Windows.Forms.CheckBox();
|
||||||
this.lblNameFormatPatternPreviewActiveWindow = new System.Windows.Forms.Label();
|
this.lblNameFormatPatternPreviewActiveWindow = new System.Windows.Forms.Label();
|
||||||
|
@ -177,8 +190,6 @@ private void InitializeComponent()
|
||||||
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.tttvMain = new ShareX.HelpersLib.TabToTreeView();
|
this.tttvMain = new ShareX.HelpersLib.TabToTreeView();
|
||||||
this.cbNameFormatTimeZone = new System.Windows.Forms.ComboBox();
|
|
||||||
this.cbNameFormatCustomTimeZone = new System.Windows.Forms.CheckBox();
|
|
||||||
this.tcTaskSettings.SuspendLayout();
|
this.tcTaskSettings.SuspendLayout();
|
||||||
this.tpTask.SuspendLayout();
|
this.tpTask.SuspendLayout();
|
||||||
this.cmsDestinations.SuspendLayout();
|
this.cmsDestinations.SuspendLayout();
|
||||||
|
@ -198,6 +209,10 @@ private void InitializeComponent()
|
||||||
this.tcCapture.SuspendLayout();
|
this.tcCapture.SuspendLayout();
|
||||||
this.tpCaptureGeneral.SuspendLayout();
|
this.tpCaptureGeneral.SuspendLayout();
|
||||||
this.pCapture.SuspendLayout();
|
this.pCapture.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudScreenRegionHeight)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudScreenRegionWidth)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudScreenRegionY)).BeginInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudScreenRegionX)).BeginInit();
|
||||||
((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.tpRegionCapture.SuspendLayout();
|
this.tpRegionCapture.SuspendLayout();
|
||||||
|
@ -771,6 +786,17 @@ private void InitializeComponent()
|
||||||
//
|
//
|
||||||
// pCapture
|
// pCapture
|
||||||
//
|
//
|
||||||
|
this.pCapture.Controls.Add(this.btnTransmitBoundsFromMonitorToCustomBounds);
|
||||||
|
this.pCapture.Controls.Add(this.lblWidth);
|
||||||
|
this.pCapture.Controls.Add(this.lblHeight);
|
||||||
|
this.pCapture.Controls.Add(this.lblY);
|
||||||
|
this.pCapture.Controls.Add(this.lblX);
|
||||||
|
this.pCapture.Controls.Add(this.nudScreenRegionHeight);
|
||||||
|
this.pCapture.Controls.Add(this.nudScreenRegionWidth);
|
||||||
|
this.pCapture.Controls.Add(this.nudScreenRegionY);
|
||||||
|
this.pCapture.Controls.Add(this.nudScreenRegionX);
|
||||||
|
this.pCapture.Controls.Add(this.lblSelectedMonitorForCustomRegion);
|
||||||
|
this.pCapture.Controls.Add(this.cboMonitors);
|
||||||
this.pCapture.Controls.Add(this.cbShowCursor);
|
this.pCapture.Controls.Add(this.cbShowCursor);
|
||||||
this.pCapture.Controls.Add(this.lblCaptureShadowOffset);
|
this.pCapture.Controls.Add(this.lblCaptureShadowOffset);
|
||||||
this.pCapture.Controls.Add(this.cbCaptureTransparent);
|
this.pCapture.Controls.Add(this.cbCaptureTransparent);
|
||||||
|
@ -784,6 +810,109 @@ private void InitializeComponent()
|
||||||
resources.ApplyResources(this.pCapture, "pCapture");
|
resources.ApplyResources(this.pCapture, "pCapture");
|
||||||
this.pCapture.Name = "pCapture";
|
this.pCapture.Name = "pCapture";
|
||||||
//
|
//
|
||||||
|
// btnTransmitBoundsFromMonitorToCustomBounds
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.btnTransmitBoundsFromMonitorToCustomBounds, "btnTransmitBoundsFromMonitorToCustomBounds");
|
||||||
|
this.btnTransmitBoundsFromMonitorToCustomBounds.Name = "btnTransmitBoundsFromMonitorToCustomBounds";
|
||||||
|
this.btnTransmitBoundsFromMonitorToCustomBounds.UseVisualStyleBackColor = true;
|
||||||
|
this.btnTransmitBoundsFromMonitorToCustomBounds.Click += new System.EventHandler(this.btnTransmitBoundsFromMonitorToCustomBounds_Click);
|
||||||
|
//
|
||||||
|
// lblWidth
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.lblWidth, "lblWidth");
|
||||||
|
this.lblWidth.Name = "lblWidth";
|
||||||
|
//
|
||||||
|
// lblHeight
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.lblHeight, "lblHeight");
|
||||||
|
this.lblHeight.Name = "lblHeight";
|
||||||
|
//
|
||||||
|
// lblY
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.lblY, "lblY");
|
||||||
|
this.lblY.Name = "lblY";
|
||||||
|
//
|
||||||
|
// lblX
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.lblX, "lblX");
|
||||||
|
this.lblX.Name = "lblX";
|
||||||
|
//
|
||||||
|
// nudScreenRegionHeight
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.nudScreenRegionHeight, "nudScreenRegionHeight");
|
||||||
|
this.nudScreenRegionHeight.Maximum = new decimal(new int[] {
|
||||||
|
-2147483648,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.nudScreenRegionHeight.Minimum = new decimal(new int[] {
|
||||||
|
-2147483648,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
-2147483648});
|
||||||
|
this.nudScreenRegionHeight.Name = "nudScreenRegionHeight";
|
||||||
|
this.nudScreenRegionHeight.ValueChanged += new System.EventHandler(this.nudScreenRegionHeight_ValueChanged);
|
||||||
|
//
|
||||||
|
// nudScreenRegionWidth
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.nudScreenRegionWidth, "nudScreenRegionWidth");
|
||||||
|
this.nudScreenRegionWidth.Maximum = new decimal(new int[] {
|
||||||
|
-2147483648,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.nudScreenRegionWidth.Minimum = new decimal(new int[] {
|
||||||
|
-2147483648,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
-2147483648});
|
||||||
|
this.nudScreenRegionWidth.Name = "nudScreenRegionWidth";
|
||||||
|
this.nudScreenRegionWidth.ValueChanged += new System.EventHandler(this.nudScreenRegionWidth_ValueChanged);
|
||||||
|
//
|
||||||
|
// nudScreenRegionY
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.nudScreenRegionY, "nudScreenRegionY");
|
||||||
|
this.nudScreenRegionY.Maximum = new decimal(new int[] {
|
||||||
|
-2147483648,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.nudScreenRegionY.Minimum = new decimal(new int[] {
|
||||||
|
-2147483648,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
-2147483648});
|
||||||
|
this.nudScreenRegionY.Name = "nudScreenRegionY";
|
||||||
|
this.nudScreenRegionY.ValueChanged += new System.EventHandler(this.nudScreenRegionY_ValueChanged);
|
||||||
|
//
|
||||||
|
// nudScreenRegionX
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.nudScreenRegionX, "nudScreenRegionX");
|
||||||
|
this.nudScreenRegionX.Maximum = new decimal(new int[] {
|
||||||
|
-2147483648,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0});
|
||||||
|
this.nudScreenRegionX.Minimum = new decimal(new int[] {
|
||||||
|
-2147483648,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
-2147483648});
|
||||||
|
this.nudScreenRegionX.Name = "nudScreenRegionX";
|
||||||
|
this.nudScreenRegionX.ValueChanged += new System.EventHandler(this.nudScreenRegionX_ValueChanged);
|
||||||
|
//
|
||||||
|
// lblSelectedMonitorForCustomRegion
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.lblSelectedMonitorForCustomRegion, "lblSelectedMonitorForCustomRegion");
|
||||||
|
this.lblSelectedMonitorForCustomRegion.Name = "lblSelectedMonitorForCustomRegion";
|
||||||
|
//
|
||||||
|
// cboMonitors
|
||||||
|
//
|
||||||
|
this.cboMonitors.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cboMonitors.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cboMonitors, "cboMonitors");
|
||||||
|
this.cboMonitors.Name = "cboMonitors";
|
||||||
|
//
|
||||||
// cbShowCursor
|
// cbShowCursor
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.cbShowCursor, "cbShowCursor");
|
resources.ApplyResources(this.cbShowCursor, "cbShowCursor");
|
||||||
|
@ -1265,6 +1394,21 @@ private void InitializeComponent()
|
||||||
resources.ApplyResources(this.pUpload, "pUpload");
|
resources.ApplyResources(this.pUpload, "pUpload");
|
||||||
this.pUpload.Name = "pUpload";
|
this.pUpload.Name = "pUpload";
|
||||||
//
|
//
|
||||||
|
// cbNameFormatCustomTimeZone
|
||||||
|
//
|
||||||
|
resources.ApplyResources(this.cbNameFormatCustomTimeZone, "cbNameFormatCustomTimeZone");
|
||||||
|
this.cbNameFormatCustomTimeZone.Name = "cbNameFormatCustomTimeZone";
|
||||||
|
this.cbNameFormatCustomTimeZone.UseVisualStyleBackColor = true;
|
||||||
|
this.cbNameFormatCustomTimeZone.CheckedChanged += new System.EventHandler(this.cbNameFormatCustomTimeZone_CheckedChanged);
|
||||||
|
//
|
||||||
|
// cbNameFormatTimeZone
|
||||||
|
//
|
||||||
|
this.cbNameFormatTimeZone.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.cbNameFormatTimeZone.FormattingEnabled = true;
|
||||||
|
resources.ApplyResources(this.cbNameFormatTimeZone, "cbNameFormatTimeZone");
|
||||||
|
this.cbNameFormatTimeZone.Name = "cbNameFormatTimeZone";
|
||||||
|
this.cbNameFormatTimeZone.SelectedIndexChanged += new System.EventHandler(this.cbNameFormatTimeZone_SelectedIndexChanged);
|
||||||
|
//
|
||||||
// lblNameFormatPattern
|
// lblNameFormatPattern
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this.lblNameFormatPattern, "lblNameFormatPattern");
|
resources.ApplyResources(this.lblNameFormatPattern, "lblNameFormatPattern");
|
||||||
|
@ -1415,21 +1559,6 @@ private void InitializeComponent()
|
||||||
this.tttvMain.TreeViewFont = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
this.tttvMain.TreeViewFont = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(162)));
|
||||||
this.tttvMain.TreeViewSize = 190;
|
this.tttvMain.TreeViewSize = 190;
|
||||||
//
|
//
|
||||||
// cbNameFormatTimeZone
|
|
||||||
//
|
|
||||||
this.cbNameFormatTimeZone.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
|
||||||
this.cbNameFormatTimeZone.FormattingEnabled = true;
|
|
||||||
resources.ApplyResources(this.cbNameFormatTimeZone, "cbNameFormatTimeZone");
|
|
||||||
this.cbNameFormatTimeZone.Name = "cbNameFormatTimeZone";
|
|
||||||
this.cbNameFormatTimeZone.SelectedIndexChanged += new System.EventHandler(this.cbNameFormatTimeZone_SelectedIndexChanged);
|
|
||||||
//
|
|
||||||
// cbNameFormatCustomTimeZone
|
|
||||||
//
|
|
||||||
resources.ApplyResources(this.cbNameFormatCustomTimeZone, "cbNameFormatCustomTimeZone");
|
|
||||||
this.cbNameFormatCustomTimeZone.Name = "cbNameFormatCustomTimeZone";
|
|
||||||
this.cbNameFormatCustomTimeZone.UseVisualStyleBackColor = true;
|
|
||||||
this.cbNameFormatCustomTimeZone.CheckedChanged += new System.EventHandler(this.cbNameFormatCustomTimeZone_CheckedChanged);
|
|
||||||
//
|
|
||||||
// TaskSettingsForm
|
// TaskSettingsForm
|
||||||
//
|
//
|
||||||
resources.ApplyResources(this, "$this");
|
resources.ApplyResources(this, "$this");
|
||||||
|
@ -1469,6 +1598,10 @@ private void InitializeComponent()
|
||||||
this.tpCaptureGeneral.PerformLayout();
|
this.tpCaptureGeneral.PerformLayout();
|
||||||
this.pCapture.ResumeLayout(false);
|
this.pCapture.ResumeLayout(false);
|
||||||
this.pCapture.PerformLayout();
|
this.pCapture.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudScreenRegionHeight)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudScreenRegionWidth)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudScreenRegionY)).EndInit();
|
||||||
|
((System.ComponentModel.ISupportInitialize)(this.nudScreenRegionX)).EndInit();
|
||||||
((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.tpRegionCapture.ResumeLayout(false);
|
this.tpRegionCapture.ResumeLayout(false);
|
||||||
|
@ -1651,6 +1784,17 @@ private void InitializeComponent()
|
||||||
private System.Windows.Forms.Button btnScreenRecorderFFmpegOptions;
|
private System.Windows.Forms.Button btnScreenRecorderFFmpegOptions;
|
||||||
private System.Windows.Forms.ComboBox cbNameFormatTimeZone;
|
private System.Windows.Forms.ComboBox cbNameFormatTimeZone;
|
||||||
private System.Windows.Forms.CheckBox cbNameFormatCustomTimeZone;
|
private System.Windows.Forms.CheckBox cbNameFormatCustomTimeZone;
|
||||||
|
private System.Windows.Forms.Label lblSelectedMonitorForCustomRegion;
|
||||||
|
private System.Windows.Forms.ComboBox cboMonitors;
|
||||||
|
private System.Windows.Forms.Label lblWidth;
|
||||||
|
private System.Windows.Forms.Label lblHeight;
|
||||||
|
private System.Windows.Forms.Label lblY;
|
||||||
|
private System.Windows.Forms.Label lblX;
|
||||||
|
private System.Windows.Forms.NumericUpDown nudScreenRegionHeight;
|
||||||
|
private System.Windows.Forms.NumericUpDown nudScreenRegionWidth;
|
||||||
|
private System.Windows.Forms.NumericUpDown nudScreenRegionY;
|
||||||
|
private System.Windows.Forms.NumericUpDown nudScreenRegionX;
|
||||||
|
private System.Windows.Forms.Button btnTransmitBoundsFromMonitorToCustomBounds;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -209,6 +209,13 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
|
||||||
cbScreenshotDelay.Checked = TaskSettings.CaptureSettings.IsDelayScreenshot;
|
cbScreenshotDelay.Checked = TaskSettings.CaptureSettings.IsDelayScreenshot;
|
||||||
nudScreenshotDelay.Value = TaskSettings.CaptureSettings.DelayScreenshot;
|
nudScreenshotDelay.Value = TaskSettings.CaptureSettings.DelayScreenshot;
|
||||||
cbCaptureAutoHideTaskbar.Checked = TaskSettings.CaptureSettings.CaptureAutoHideTaskbar;
|
cbCaptureAutoHideTaskbar.Checked = TaskSettings.CaptureSettings.CaptureAutoHideTaskbar;
|
||||||
|
cboMonitors.Items.Clear();
|
||||||
|
cboMonitors.Items.AddRange(MonitorRegionDefaultCreator.AllMonitorsRegions);
|
||||||
|
cboMonitors.SelectedIndex = TaskSettings.CaptureSettings.DefaultScreenRegionCboIndex;
|
||||||
|
nudScreenRegionX.Value = TaskSettings.CaptureSettings.DefaultBounds.X;
|
||||||
|
nudScreenRegionY.Value = TaskSettings.CaptureSettings.DefaultBounds.Y;
|
||||||
|
nudScreenRegionWidth.Value = TaskSettings.CaptureSettings.DefaultBounds.Width;
|
||||||
|
nudScreenRegionHeight.Value = TaskSettings.CaptureSettings.DefaultBounds.Height;
|
||||||
|
|
||||||
// Capture / Region capture
|
// Capture / Region capture
|
||||||
if (TaskSettings.CaptureSettings.SurfaceOptions == null) TaskSettings.CaptureSettings.SurfaceOptions = new SurfaceOptions();
|
if (TaskSettings.CaptureSettings.SurfaceOptions == null) TaskSettings.CaptureSettings.SurfaceOptions = new SurfaceOptions();
|
||||||
|
@ -755,6 +762,30 @@ private void cbCaptureTransparent_CheckedChanged(object sender, EventArgs e)
|
||||||
cbCaptureShadow.Enabled = TaskSettings.CaptureSettings.CaptureTransparent;
|
cbCaptureShadow.Enabled = TaskSettings.CaptureSettings.CaptureTransparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void nudScreenRegionX_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
NumericUpDown nudX = (NumericUpDown)sender;
|
||||||
|
TaskSettings.CaptureSettings.DefaultBounds.X = (int)nudX.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nudScreenRegionY_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
NumericUpDown nudY = (NumericUpDown)sender;
|
||||||
|
TaskSettings.CaptureSettings.DefaultBounds.Y = (int)nudY.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nudScreenRegionWidth_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
NumericUpDown nudWidth = (NumericUpDown)sender;
|
||||||
|
TaskSettings.CaptureSettings.DefaultBounds.Width = (int)nudWidth.Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void nudScreenRegionHeight_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
NumericUpDown nudHeight = (NumericUpDown)sender;
|
||||||
|
TaskSettings.CaptureSettings.DefaultBounds.Height = (int)nudHeight.Value;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Capture
|
#endregion Capture
|
||||||
|
|
||||||
#region Screen recorder
|
#region Screen recorder
|
||||||
|
@ -1100,5 +1131,14 @@ private void chkUseDefaultAdvancedSettings_CheckedChanged(object sender, EventAr
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Advanced
|
#endregion Advanced
|
||||||
|
|
||||||
|
private void btnTransmitBoundsFromMonitorToCustomBounds_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
MonitorRegion monitorRegionSelected = (MonitorRegion)cboMonitors.SelectedItem;
|
||||||
|
nudScreenRegionX.Value = monitorRegionSelected.X;
|
||||||
|
nudScreenRegionY.Value = monitorRegionSelected.Y;
|
||||||
|
nudScreenRegionWidth.Value = monitorRegionSelected.Width;
|
||||||
|
nudScreenRegionHeight.Value = monitorRegionSelected.Height;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load diff
|
@ -417,6 +417,14 @@ public static UpdateChecker CheckUpdate()
|
||||||
return updateChecker;
|
return updateChecker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CheckDownloadCounts()
|
||||||
|
{
|
||||||
|
GitHubUpdateChecker updateChecker = new GitHubUpdateChecker("ShareX", "ShareX");
|
||||||
|
updateChecker.Proxy = HelpersOptions.CurrentProxy.GetWebProxy();
|
||||||
|
string output = updateChecker.GetDownloadCounts();
|
||||||
|
Debug.WriteLine(output);
|
||||||
|
}
|
||||||
|
|
||||||
public static string CheckFilePath(string folder, string filename, TaskSettings taskSettings)
|
public static string CheckFilePath(string folder, string filename, TaskSettings taskSettings)
|
||||||
{
|
{
|
||||||
string filepath = Path.Combine(folder, filename);
|
string filepath = Path.Combine(folder, filename);
|
||||||
|
|
|
@ -312,6 +312,13 @@ public class TaskSettingsCapture
|
||||||
public RectangleAnnotateOptions RectangleAnnotateOptions = new RectangleAnnotateOptions();
|
public RectangleAnnotateOptions RectangleAnnotateOptions = new RectangleAnnotateOptions();
|
||||||
|
|
||||||
#endregion Capture / Rectangle annotate
|
#endregion Capture / Rectangle annotate
|
||||||
|
|
||||||
|
#region Custom Capture Region
|
||||||
|
|
||||||
|
public Rectangle DefaultBounds = new Rectangle(0, 0, 0, 0);
|
||||||
|
public int DefaultScreenRegionCboIndex = 0;
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TaskSettingsUpload
|
public class TaskSettingsUpload
|
||||||
|
|
Loading…
Reference in a new issue