mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Moved unused effect from Surface internal to IEffect implementation
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2383 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
6f633dbeb2
commit
e7ab5f5677
2 changed files with 38 additions and 43 deletions
|
@ -183,4 +183,42 @@ namespace Greenshot.Core {
|
|||
return ImageHelper.ResizeBitmap(sourceBitmap, MaintainAspectRatio, Width, Height);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GrowEffect
|
||||
/// </summary>
|
||||
public class GrowEffect : IEffect {
|
||||
public GrowEffect(int left, int right, int top, int bottom) {
|
||||
Left = left;
|
||||
Right = right;
|
||||
Top = top;
|
||||
Bottom = bottom;
|
||||
BackgroundColor = Color.Empty; // Uses the default background color depending on the format
|
||||
}
|
||||
public int Left {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public int Right {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public int Top {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public int Bottom {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public Color BackgroundColor {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public Bitmap Apply(Bitmap sourceBitmap, out Point offsetChange) {
|
||||
// Make sure the elements move according to the offset the effect made the bitmap move
|
||||
offsetChange = new Point(Left, Top);
|
||||
return ImageHelper.GrowCanvas(sourceBitmap, BackgroundColor, Left, Right, Top, Bottom);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue