diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs index b6957d744..ca9265a50 100644 --- a/Greenshot/Forms/ImageEditorForm.cs +++ b/Greenshot/Forms/ImageEditorForm.cs @@ -38,6 +38,7 @@ using Greenshot.Plugin; using GreenshotPlugin.Core; using IniFile; using System.Threading; +using System.Drawing.Imaging; namespace Greenshot { /// @@ -1151,7 +1152,15 @@ namespace Greenshot { this.Activate(); WindowDetails.ToForeground(this.Handle); if (capture!= null && capture.Image != null) { - surface.AddBitmapContainer((Bitmap)capture.Image, 100, 100); + bool addShadow = false; + if (addShadow) { + Point offset = new Point(6, 6); + using (Bitmap shadowImage = ImageHelper.CreateShadow(capture.Image, 1f, 7, offset, PixelFormat.Format32bppArgb)) { + surface.AddBitmapContainer(shadowImage, 100, 100); + } + } else { + surface.AddBitmapContainer((Bitmap)capture.Image, 100, 100); + } } } diff --git a/GreenshotPlugin/Core/ImageHelper.cs b/GreenshotPlugin/Core/ImageHelper.cs index 56e44d50a..87ff3d09d 100644 --- a/GreenshotPlugin/Core/ImageHelper.cs +++ b/GreenshotPlugin/Core/ImageHelper.cs @@ -583,7 +583,7 @@ namespace GreenshotPlugin.Core { /// What pixel format must the returning bitmap have /// How many pixels is the original image moved? /// Bitmap with the shadow, is bigger than the sourceBitmap!! - public static Bitmap CreateShadow(Bitmap sourceBitmap, float darkness, int shadowSize, Point offset, PixelFormat targetPixelformat) { + public static Bitmap CreateShadow(Image sourceBitmap, float darkness, int shadowSize, Point offset, PixelFormat targetPixelformat) { // Create a new "clean" image Bitmap newImage = new Bitmap(sourceBitmap.Width + (shadowSize * 2), sourceBitmap.Height + (shadowSize * 2), targetPixelformat); newImage.SetResolution(sourceBitmap.HorizontalResolution, sourceBitmap.VerticalResolution);