diff --git a/Greenshot/Drawing/Surface.cs b/Greenshot/Drawing/Surface.cs index e8b90026d..38df57973 100644 --- a/Greenshot/Drawing/Surface.cs +++ b/Greenshot/Drawing/Surface.cs @@ -2045,10 +2045,12 @@ namespace Greenshot.Drawing /// public IDrawableContainerList Elements => _elements; - /// - /// pulls selected elements up one level in hierarchy - /// - public void PullElementsUp() + public bool HasDefaultEffect { get; set; } = false; + + /// + /// pulls selected elements up one level in hierarchy + /// + public void PullElementsUp() { _elements.PullElementsUp(selectedElements); _elements.Invalidate(); diff --git a/GreenshotPlugin/Core/AbstractDestination.cs b/GreenshotPlugin/Core/AbstractDestination.cs index 1431636b5..15d2479a8 100644 --- a/GreenshotPlugin/Core/AbstractDestination.cs +++ b/GreenshotPlugin/Core/AbstractDestination.cs @@ -99,7 +99,11 @@ namespace GreenshotPlugin.Core { return; } //set default border effect. - surface.ApplyBitmapEffect(new Effects.BorderEffect()); + if (!surface.HasDefaultEffect) + { + surface.ApplyBitmapEffect(new Effects.DefaultEffect()); + surface.HasDefaultEffect = true; + } } public abstract ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails); diff --git a/GreenshotPlugin/Effects/DefaultEffect.cs b/GreenshotPlugin/Effects/DefaultEffect.cs new file mode 100644 index 000000000..b3e0b1e57 --- /dev/null +++ b/GreenshotPlugin/Effects/DefaultEffect.cs @@ -0,0 +1,40 @@ +using GreenshotPlugin.Core; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace GreenshotPlugin.Effects +{ + /// + /// default effect. + /// + public class DefaultEffect : IEffect + { + public DefaultEffect() + { + this.Reset(); + } + + public Color Color + { + get; + set; + } + + public int Width + { + get; + set; + } + + public Image Apply(Image sourceImage, Matrix matrix) + { + return ImageHelper.CreateBorder(sourceImage, Width, Color, sourceImage.PixelFormat, matrix); + } + + public void Reset() + { + this.Width = 2; + this.Color = Color.Gray; + } + } +} \ No newline at end of file diff --git a/GreenshotPlugin/GreenshotPlugin.csproj b/GreenshotPlugin/GreenshotPlugin.csproj index 1c3ab8ce7..da355b746 100644 --- a/GreenshotPlugin/GreenshotPlugin.csproj +++ b/GreenshotPlugin/GreenshotPlugin.csproj @@ -50,6 +50,7 @@ + diff --git a/GreenshotPlugin/Interfaces/Generic.cs b/GreenshotPlugin/Interfaces/Generic.cs index 4fc2da7aa..553e18d78 100644 --- a/GreenshotPlugin/Interfaces/Generic.cs +++ b/GreenshotPlugin/Interfaces/Generic.cs @@ -263,5 +263,7 @@ namespace Greenshot.Plugin int Height { get; } void MakeUndoable(IMemento memento, bool allowMerge); + + bool HasDefaultEffect { get; set; } } } \ No newline at end of file