mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Added a background color for some of the ImageHelper methods, this makes it more flexible.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1762 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
18e0d88b0c
commit
72d3de218b
2 changed files with 43 additions and 14 deletions
|
@ -545,7 +545,30 @@ namespace Greenshot.Drawing {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// "Grow" the canvas with the specified pixels on the left, right, top and bottom. Using the backgroundColor.
|
||||
/// </summary>
|
||||
/// <param name="backgroundColor"></param>
|
||||
/// <param name="left"></param>
|
||||
/// <param name="right"></param>
|
||||
/// <param name="top"></param>
|
||||
/// <param name="bottom"></param>
|
||||
public void GrowCanvas(Color backgroundColor, int left, int right, int top, int bottom) {
|
||||
Bitmap newImage = ImageHelper.GrowCanvas((Bitmap)Image, backgroundColor, left, right, top, bottom);
|
||||
// Make sure the elements move according to the offset the effect made the bitmap move
|
||||
elements.MoveBy(left, top);
|
||||
// Make undoable
|
||||
MakeUndoable(new SurfaceBackgroundChangeMemento(this, new Point(left, top)), false);
|
||||
SetImage(newImage, false);
|
||||
Invalidate();
|
||||
SurfaceSizeChanged(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Apply a bitmap effect to the surface
|
||||
/// </summary>
|
||||
/// <param name="effect"></param>
|
||||
public void ApplyBitmapEffect(Effects effect) {
|
||||
BackgroundForm backgroundForm = new BackgroundForm("Effect", "Please wait");
|
||||
backgroundForm.Show();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue