Added key handling for the effects and added a clear operation. Also some code cleanup.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2360 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-12-06 17:06:26 +00:00
parent 82eddefe4e
commit e148f2103c
3 changed files with 70 additions and 38 deletions

View file

@ -1115,7 +1115,11 @@ namespace GreenshotPlugin.Core {
/// <param name="backgroundColor">The color to fill with, or Color.Empty to take the default depending on the pixel format</param>
/// <returns></returns>
public static Bitmap CreateEmptyLike(Bitmap sourceBitmap, Color backgroundColor) {
return CreateEmpty(sourceBitmap.Width, sourceBitmap.Height, sourceBitmap.PixelFormat, backgroundColor, sourceBitmap.HorizontalResolution, sourceBitmap.VerticalResolution);
PixelFormat pixelFormat = sourceBitmap.PixelFormat;
if (backgroundColor.A < 255) {
pixelFormat = PixelFormat.Format32bppArgb;
}
return CreateEmpty(sourceBitmap.Width, sourceBitmap.Height, pixelFormat, backgroundColor, sourceBitmap.HorizontalResolution, sourceBitmap.VerticalResolution);
}
/// <summary>