Small change to allow window capture and automatically add a shadow, only inside the editor.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1652 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-02-10 16:57:25 +00:00
parent c8fc93ee53
commit 594f8f9a0a
2 changed files with 11 additions and 2 deletions

View file

@ -38,6 +38,7 @@ using Greenshot.Plugin;
using GreenshotPlugin.Core;
using IniFile;
using System.Threading;
using System.Drawing.Imaging;
namespace Greenshot {
/// <summary>
@ -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);
}
}
}