RegionCaptureOptions rename and changes
This commit is contained in:
parent
305843177a
commit
0b71daed4e
@ -41,7 +41,7 @@ namespace ShareX.ScreenCaptureLib
|
|||||||
{
|
{
|
||||||
public static GraphicsPath LastRegionFillPath { get; protected set; }
|
public static GraphicsPath LastRegionFillPath { get; protected set; }
|
||||||
|
|
||||||
public SurfaceOptions Config { get; set; }
|
public RegionCaptureOptions Config { get; set; }
|
||||||
public int FPS { get; private set; }
|
public int FPS { get; private set; }
|
||||||
public Rectangle ScreenRectangle { get; private set; }
|
public Rectangle ScreenRectangle { get; private set; }
|
||||||
public Rectangle ScreenRectangle0Based { get; private set; }
|
public Rectangle ScreenRectangle0Based { get; private set; }
|
||||||
@ -73,7 +73,7 @@ namespace ShareX.ScreenCaptureLib
|
|||||||
}
|
}
|
||||||
|
|
||||||
drawableObjects = new List<DrawableObject>();
|
drawableObjects = new List<DrawableObject>();
|
||||||
Config = new SurfaceOptions();
|
Config = new RegionCaptureOptions();
|
||||||
timerStart = new Stopwatch();
|
timerStart = new Stopwatch();
|
||||||
timerFPS = new Stopwatch();
|
timerFPS = new Stopwatch();
|
||||||
|
|
||||||
|
78
ShareX.ScreenCaptureLib/RegionCaptureOptions.cs
Normal file
78
ShareX.ScreenCaptureLib/RegionCaptureOptions.cs
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
#region License Information (GPL v3)
|
||||||
|
|
||||||
|
/*
|
||||||
|
ShareX - A program that allows you to take screenshots and share any file type
|
||||||
|
Copyright (c) 2007-2016 ShareX Team
|
||||||
|
|
||||||
|
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 ShareX.HelpersLib;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace ShareX.ScreenCaptureLib
|
||||||
|
{
|
||||||
|
public class RegionCaptureOptions
|
||||||
|
{
|
||||||
|
// Settings in task settings window
|
||||||
|
|
||||||
|
public bool QuickCrop = true;
|
||||||
|
public RegionCaptureAction MouseRightClickAction = RegionCaptureAction.OpenOptionsMenu;
|
||||||
|
public RegionCaptureAction MouseMiddleClickAction = RegionCaptureAction.CancelCapture;
|
||||||
|
public RegionCaptureAction Mouse4ClickAction = RegionCaptureAction.SwapToolType;
|
||||||
|
public RegionCaptureAction Mouse5ClickAction = RegionCaptureAction.CaptureFullscreen;
|
||||||
|
public bool DetectWindows = true;
|
||||||
|
public bool DetectControls = true;
|
||||||
|
public bool UseDimming = true;
|
||||||
|
public bool UseCustomInfoText = false;
|
||||||
|
public string CustomInfoText = "X: $x, Y: $y\r\nR: $r, G: $g, B: $b\r\nHex: $hex"; // Formats: $x, $y, $r, $g, $b, $hex
|
||||||
|
public List<SnapSize> SnapSizes = new List<SnapSize>()
|
||||||
|
{
|
||||||
|
new SnapSize(426, 240), // 240p
|
||||||
|
new SnapSize(640, 360), // 360p
|
||||||
|
new SnapSize(854, 480), // 480p
|
||||||
|
new SnapSize(1280, 720), // 720p
|
||||||
|
new SnapSize(1920, 1080) // 1080p
|
||||||
|
};
|
||||||
|
|
||||||
|
// Settings in region capture right click menu
|
||||||
|
|
||||||
|
public AnnotationOptions AnnotationOptions = new AnnotationOptions();
|
||||||
|
public bool ShowTips = true;
|
||||||
|
public bool ShowInfo = true;
|
||||||
|
public bool ShowMagnifier = true;
|
||||||
|
public bool UseSquareMagnifier = false;
|
||||||
|
public int MagnifierPixelCount = 15; // Must be odd number like 11, 13, 15 etc.
|
||||||
|
public int MagnifierPixelSize = 10;
|
||||||
|
public bool ShowCrosshair = false;
|
||||||
|
public bool IsFixedSize = false;
|
||||||
|
public Size FixedSize = new Size(250, 250);
|
||||||
|
public bool ShowFPS = false;
|
||||||
|
|
||||||
|
// Settings not changeable from UI
|
||||||
|
|
||||||
|
public ShapeType LastRegionTool = ShapeType.RegionRectangle;
|
||||||
|
public ShapeType LastAnnotationTool = ShapeType.DrawingRectangle;
|
||||||
|
public bool ShowMenuTip = true;
|
||||||
|
public int MinMoveSpeed = 1;
|
||||||
|
public int MaxMoveSpeed = 10;
|
||||||
|
public int SnapDistance = 20;
|
||||||
|
}
|
||||||
|
}
|
@ -145,7 +145,7 @@ namespace ShareX.ScreenCaptureLib
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Image ApplyRegionPathToImage(Image backgroundImage, GraphicsPath regionFillPath, SurfaceOptions options)
|
public static Image ApplyRegionPathToImage(Image backgroundImage, GraphicsPath regionFillPath, RegionCaptureOptions options)
|
||||||
{
|
{
|
||||||
if (backgroundImage != null && regionFillPath != null)
|
if (backgroundImage != null && regionFillPath != null)
|
||||||
{
|
{
|
||||||
|
@ -184,7 +184,7 @@ namespace ShareX.ScreenCaptureLib
|
|||||||
public bool WindowCaptureMode { get; set; }
|
public bool WindowCaptureMode { get; set; }
|
||||||
public bool IncludeControls { get; set; }
|
public bool IncludeControls { get; set; }
|
||||||
|
|
||||||
public SurfaceOptions Config { get; private set; }
|
public RegionCaptureOptions Config { get; private set; }
|
||||||
|
|
||||||
public AnnotationOptions AnnotationOptions
|
public AnnotationOptions AnnotationOptions
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@
|
|||||||
<Compile Include="Shapes\Region\RoundedRectangleRegionShape.cs" />
|
<Compile Include="Shapes\Region\RoundedRectangleRegionShape.cs" />
|
||||||
<Compile Include="SimpleWindowInfo.cs" />
|
<Compile Include="SimpleWindowInfo.cs" />
|
||||||
<Compile Include="SnapSize.cs" />
|
<Compile Include="SnapSize.cs" />
|
||||||
<Compile Include="SurfaceOptions.cs" />
|
<Compile Include="RegionCaptureOptions.cs" />
|
||||||
<Compile Include="Screencast\ScreenRecorder.cs" />
|
<Compile Include="Screencast\ScreenRecorder.cs" />
|
||||||
<Compile Include="Screencast\HardDiskCache.cs" />
|
<Compile Include="Screencast\HardDiskCache.cs" />
|
||||||
<Compile Include="Screenshot.cs" />
|
<Compile Include="Screenshot.cs" />
|
||||||
|
@ -1,134 +0,0 @@
|
|||||||
#region License Information (GPL v3)
|
|
||||||
|
|
||||||
/*
|
|
||||||
ShareX - A program that allows you to take screenshots and share any file type
|
|
||||||
Copyright (c) 2007-2016 ShareX Team
|
|
||||||
|
|
||||||
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 ShareX.HelpersLib;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.ComponentModel.Design;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Drawing.Design;
|
|
||||||
|
|
||||||
namespace ShareX.ScreenCaptureLib
|
|
||||||
{
|
|
||||||
public class SurfaceOptions
|
|
||||||
{
|
|
||||||
[DefaultValue(true), Description("Allow screenshot capture as soon as the mouse is released. This disables the ability to capture multiple shapes and to move and/or resize them.")]
|
|
||||||
public bool QuickCrop { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(RegionCaptureAction.OpenOptionsMenu), Description("What should happen when you right click in region capture?"), TypeConverter(typeof(EnumDescriptionConverter))]
|
|
||||||
public RegionCaptureAction MouseRightClickAction { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(RegionCaptureAction.CancelCapture), Description("What should happen when you middle click in region capture?"), TypeConverter(typeof(EnumDescriptionConverter))]
|
|
||||||
public RegionCaptureAction MouseMiddleClickAction { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(RegionCaptureAction.SwapToolType), Description("What should happen when you mouse 4 click in region capture?"), TypeConverter(typeof(EnumDescriptionConverter))]
|
|
||||||
public RegionCaptureAction Mouse4ClickAction { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(RegionCaptureAction.CaptureFullscreen), Description("What should happen when you mouse 5 click in region capture?"), TypeConverter(typeof(EnumDescriptionConverter))]
|
|
||||||
public RegionCaptureAction Mouse5ClickAction { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(true), Description("Allows selection of window regions in region capture.")]
|
|
||||||
public bool DetectWindows { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(true), Description("If detect windows setting is chosen, this setting will also allow detecting window controls.")]
|
|
||||||
public bool DetectControls { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(true), Description("Show coordinate and size information.")]
|
|
||||||
public bool ShowInfo { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(false), Description("Allows to show your custom info text near cursor. This way you can show color info too.")]
|
|
||||||
public bool UseCustomInfoText { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue("X: $x, Y: $y\r\nR: $r, G: $g, B: $b\r\nHex: $hex"), Description("Show this custom info when color info setting is enabled. Formats: $x, $y, $r, $g, $b, $hex"),
|
|
||||||
Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
|
|
||||||
public string CustomInfoText { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(true), Description("Show hotkeys/tips.")]
|
|
||||||
public bool ShowTips { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(true), Description("Show magnifier.")]
|
|
||||||
public bool ShowMagnifier { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(false), Description("Use square or circle shape magnifier.")]
|
|
||||||
public bool UseSquareMagnifier { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(15), Description("Number of pixels in magnifier. Must be odd number like 11, 13, 15 etc.")]
|
|
||||||
public int MagnifierPixelCount { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(10), Description("Size of pixels in magnifier.")]
|
|
||||||
public int MagnifierPixelSize { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(false), Description("Show screen wide crosshair.")]
|
|
||||||
public bool ShowCrosshair { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(true), Description("Capturing screen will dim the screen outside selected area. This may impact on the startup time of the capture process at high resolutions.")]
|
|
||||||
public bool UseDimming { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(false), Description("Show frames per second.")]
|
|
||||||
public bool ShowFPS { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(1), Description("Number of pixels to move shape at each arrow key stroke.")]
|
|
||||||
public int MinMoveSpeed { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(10), Description("Number of pixels to move shape at each arrow key stroke while holding Ctrl key.")]
|
|
||||||
public int MaxMoveSpeed { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(false), Description("Fixed shape size.")]
|
|
||||||
public bool IsFixedSize { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(typeof(Size), "250, 250"), Description("Fixed shape size.")]
|
|
||||||
public Size FixedSize { get; set; }
|
|
||||||
|
|
||||||
[DefaultValue(20), Description("How much region size must be close to snap size for it to snap.")]
|
|
||||||
public int SnapDistance { get; set; }
|
|
||||||
|
|
||||||
[Description("How close to a snap size you must be for it to snap.")]
|
|
||||||
public List<SnapSize> SnapSizes { get; set; }
|
|
||||||
|
|
||||||
public bool ShowMenuTip = true;
|
|
||||||
|
|
||||||
public ShapeType LastRegionTool = ShapeType.RegionRectangle;
|
|
||||||
|
|
||||||
public ShapeType LastAnnotationTool = ShapeType.DrawingRectangle;
|
|
||||||
|
|
||||||
public AnnotationOptions AnnotationOptions = new AnnotationOptions();
|
|
||||||
|
|
||||||
public SurfaceOptions()
|
|
||||||
{
|
|
||||||
this.ApplyDefaultPropertyValues();
|
|
||||||
|
|
||||||
SnapSizes = new List<SnapSize>()
|
|
||||||
{
|
|
||||||
new SnapSize(426, 240), // 240p
|
|
||||||
new SnapSize(640, 360), // 360p
|
|
||||||
new SnapSize(854, 480), // 480p
|
|
||||||
new SnapSize(1280, 720), // 720p
|
|
||||||
new SnapSize(1920, 1080), // 1080p
|
|
||||||
new SnapSize(2560, 1440), // 1440p
|
|
||||||
new SnapSize(3840, 2160) // 2160p
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -208,7 +208,7 @@ namespace ShareX
|
|||||||
nudCaptureCustomRegionHeight.SetValue(TaskSettings.CaptureSettings.CaptureCustomRegion.Height);
|
nudCaptureCustomRegionHeight.SetValue(TaskSettings.CaptureSettings.CaptureCustomRegion.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 RegionCaptureOptions();
|
||||||
pgRegionCapture.SelectedObject = TaskSettings.CaptureSettings.SurfaceOptions;
|
pgRegionCapture.SelectedObject = TaskSettings.CaptureSettings.SurfaceOptions;
|
||||||
|
|
||||||
// Capture / Screen recorder
|
// Capture / Screen recorder
|
||||||
|
@ -318,7 +318,7 @@ namespace ShareX
|
|||||||
|
|
||||||
#region Capture / Region capture
|
#region Capture / Region capture
|
||||||
|
|
||||||
public SurfaceOptions SurfaceOptions = new SurfaceOptions();
|
public RegionCaptureOptions SurfaceOptions = new RegionCaptureOptions();
|
||||||
|
|
||||||
#endregion Capture / Region capture
|
#endregion Capture / Region capture
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user