mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 04:30:49 +12:00
Merge pull request #377 from peppy/toggle_surface_dim
Add a toggle for screen dimming when selecting a region.
This commit is contained in:
commit
73bdd05527
|
@ -107,11 +107,14 @@ protected override void Draw(Graphics g)
|
|||
{
|
||||
g.SmoothingMode = SmoothingMode.HighQuality;
|
||||
|
||||
using (Region region = new Region(regionFillPath))
|
||||
if (Config.UseDimming)
|
||||
{
|
||||
g.Clip = region;
|
||||
g.FillRectangle(lightBackgroundBrush, ScreenRectangle0Based);
|
||||
g.ResetClip();
|
||||
using (Region region = new Region(regionFillPath))
|
||||
{
|
||||
g.Clip = region;
|
||||
g.FillRectangle(lightBackgroundBrush, ScreenRectangle0Based);
|
||||
g.ResetClip();
|
||||
}
|
||||
}
|
||||
|
||||
g.DrawPath(borderPen, regionFillPath);
|
||||
|
|
|
@ -124,11 +124,14 @@ protected override void Draw(Graphics g)
|
|||
{
|
||||
regionFillPath.CloseFigure();
|
||||
|
||||
using (Region region = new Region(regionFillPath))
|
||||
if (Config.UseDimming)
|
||||
{
|
||||
g.Clip = region;
|
||||
g.FillRectangle(lightBackgroundBrush, ScreenRectangle0Based);
|
||||
g.ResetClip();
|
||||
using (Region region = new Region(regionFillPath))
|
||||
{
|
||||
g.Clip = region;
|
||||
g.FillRectangle(lightBackgroundBrush, ScreenRectangle0Based);
|
||||
g.ResetClip();
|
||||
}
|
||||
}
|
||||
|
||||
g.DrawRectangleProper(borderPen, currentArea);
|
||||
|
|
|
@ -166,11 +166,14 @@ protected override void Draw(Graphics g)
|
|||
|
||||
if (areas.Count > 0)
|
||||
{
|
||||
using (Region region = new Region(regionDrawPath))
|
||||
if (Config.UseDimming)
|
||||
{
|
||||
g.Clip = region;
|
||||
g.FillRectangle(lightBackgroundBrush, ScreenRectangle0Based);
|
||||
g.ResetClip();
|
||||
using (Region region = new Region(regionDrawPath))
|
||||
{
|
||||
g.Clip = region;
|
||||
g.FillRectangle(lightBackgroundBrush, ScreenRectangle0Based);
|
||||
g.ResetClip();
|
||||
}
|
||||
}
|
||||
|
||||
g.DrawPath(borderPen, regionDrawPath);
|
||||
|
|
|
@ -113,14 +113,21 @@ public virtual void Prepare()
|
|||
SurfaceImage = Screenshot.CaptureFullscreen();
|
||||
}
|
||||
|
||||
using (Image darkSurfaceImage = ColorMatrixManager.Contrast(0.9f).Apply(SurfaceImage))
|
||||
if (Config.UseDimming)
|
||||
{
|
||||
darkBackgroundBrush = new TextureBrush(darkSurfaceImage) { WrapMode = WrapMode.Clamp };
|
||||
}
|
||||
using (Image darkSurfaceImage = ColorMatrixManager.Contrast(0.9f).Apply(SurfaceImage))
|
||||
{
|
||||
darkBackgroundBrush = new TextureBrush(darkSurfaceImage) { WrapMode = WrapMode.Clamp };
|
||||
}
|
||||
|
||||
using (Image lightSurfaceImage = ColorMatrixManager.Contrast(1.1f).Apply(SurfaceImage))
|
||||
using (Image lightSurfaceImage = ColorMatrixManager.Contrast(1.1f).Apply(SurfaceImage))
|
||||
{
|
||||
lightBackgroundBrush = new TextureBrush(lightSurfaceImage) { WrapMode = WrapMode.Clamp };
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lightBackgroundBrush = new TextureBrush(lightSurfaceImage) { WrapMode = WrapMode.Clamp };
|
||||
darkBackgroundBrush = new TextureBrush(SurfaceImage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,9 @@ public class SurfaceOptions
|
|||
[DefaultValue(true), Description("Show screen wide crosshair.")]
|
||||
public bool ShowCrosshair { get; set; }
|
||||
|
||||
[DefaultValue(true), Description("Cropping move will dim the screen during selection. Can be intensive at high resolutions.")]
|
||||
public bool UseDimming { get; set; }
|
||||
|
||||
[DefaultValue(false), Description("Show frames per second.")]
|
||||
public bool ShowFPS { get; set; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue