mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Added "no shadow" for the Torn-Edge effect, also fixed some tear bugs (hopefully) and simplified the code.
This commit is contained in:
parent
fb993c2238
commit
8c22a44b33
4 changed files with 131 additions and 83 deletions
|
@ -70,6 +70,7 @@ namespace Greenshot.Core {
|
|||
HorizontalToothRange = 20;
|
||||
VerticalToothRange = 20;
|
||||
Edges = new bool[] {true, true, true, true};
|
||||
GenerateShadow = true;
|
||||
}
|
||||
public int ToothHeight {
|
||||
get;
|
||||
|
@ -87,10 +88,19 @@ namespace Greenshot.Core {
|
|||
get;
|
||||
set;
|
||||
}
|
||||
public bool GenerateShadow {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public override Image Apply(Image sourceImage, Matrix matrix) {
|
||||
using (Image tmpTornImage = ImageHelper.CreateTornEdge(sourceImage, ToothHeight, HorizontalToothRange, VerticalToothRange, Edges)) {
|
||||
return ImageHelper.CreateShadow(tmpTornImage, Darkness, ShadowSize, ShadowOffset, matrix, PixelFormat.Format32bppArgb);
|
||||
Image tmpTornImage = ImageHelper.CreateTornEdge(sourceImage, ToothHeight, HorizontalToothRange, VerticalToothRange, Edges);
|
||||
if (GenerateShadow) {
|
||||
using (tmpTornImage) {
|
||||
return ImageHelper.CreateShadow(tmpTornImage, Darkness, ShadowSize, ShadowOffset, matrix, PixelFormat.Format32bppArgb);
|
||||
}
|
||||
}
|
||||
return tmpTornImage;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue