mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 14:03:23 -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
|
@ -834,49 +834,6 @@ 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();
|
||||
if (surfaceSizeChanged != null) {
|
||||
surfaceSizeChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Resize bitmap
|
||||
/// </summary>
|
||||
/// <param name="backgroundColor"></param>
|
||||
/// <param name="left"></param>
|
||||
/// <param name="right"></param>
|
||||
/// <param name="top"></param>
|
||||
/// <param name="bottom"></param>
|
||||
public void ResizeBitmap(bool lockAspectRatio, bool canvasUsedNewSize, Color backgroundColor, int newWidth, int newHeight) {
|
||||
Point offset;
|
||||
Bitmap newImage = ImageHelper.ResizeBitmap((Bitmap)Image, lockAspectRatio, canvasUsedNewSize, backgroundColor, newWidth, newHeight, out offset);
|
||||
// Make sure the elements move according to the offset the effect made the bitmap move
|
||||
elements.MoveBy(offset.X, offset.Y);
|
||||
// Make undoable
|
||||
MakeUndoable(new SurfaceBackgroundChangeMemento(this, offset), false);
|
||||
SetImage(newImage, false);
|
||||
Invalidate();
|
||||
if (surfaceSizeChanged != null) {
|
||||
surfaceSizeChanged(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A simple clear
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue