diff --git a/src/Greenshot.Editor/Drawing/Filters/GrayscaleFilter.cs b/src/Greenshot.Editor/Drawing/Filters/GrayscaleFilter.cs index 441102980..ab540f4e0 100644 --- a/src/Greenshot.Editor/Drawing/Filters/GrayscaleFilter.cs +++ b/src/Greenshot.Editor/Drawing/Filters/GrayscaleFilter.cs @@ -56,6 +56,13 @@ namespace Greenshot.Editor.Drawing.Filters graphics.ExcludeClip(rect); } + DrawGray(graphics, applyBitmap, applyRect); + + graphics.Restore(state); + } + + public static void DrawGray(Graphics graphics, Bitmap applyBitmap, NativeRect applyRect) + { ColorMatrix grayscaleMatrix = new ColorMatrix(new[] { new[] @@ -83,9 +90,7 @@ namespace Greenshot.Editor.Drawing.Filters { ia.SetColorMatrix(grayscaleMatrix); graphics.DrawImage(applyBitmap, applyRect, applyRect.X, applyRect.Y, applyRect.Width, applyRect.Height, GraphicsUnit.Pixel, ia); - } - - graphics.Restore(state); + } } } } \ No newline at end of file