mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
Split off DrawGray method
This commit is contained in:
parent
af04773497
commit
903929b3ee
1 changed files with 8 additions and 3 deletions
|
@ -56,6 +56,13 @@ namespace Greenshot.Editor.Drawing.Filters
|
||||||
graphics.ExcludeClip(rect);
|
graphics.ExcludeClip(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DrawGray(graphics, applyBitmap, applyRect);
|
||||||
|
|
||||||
|
graphics.Restore(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DrawGray(Graphics graphics, Bitmap applyBitmap, NativeRect applyRect)
|
||||||
|
{
|
||||||
ColorMatrix grayscaleMatrix = new ColorMatrix(new[]
|
ColorMatrix grayscaleMatrix = new ColorMatrix(new[]
|
||||||
{
|
{
|
||||||
new[]
|
new[]
|
||||||
|
@ -84,8 +91,6 @@ namespace Greenshot.Editor.Drawing.Filters
|
||||||
ia.SetColorMatrix(grayscaleMatrix);
|
ia.SetColorMatrix(grayscaleMatrix);
|
||||||
graphics.DrawImage(applyBitmap, applyRect, applyRect.X, applyRect.Y, applyRect.Width, applyRect.Height, GraphicsUnit.Pixel, ia);
|
graphics.DrawImage(applyBitmap, applyRect, applyRect.X, applyRect.Y, applyRect.Width, applyRect.Height, GraphicsUnit.Pixel, ia);
|
||||||
}
|
}
|
||||||
|
|
||||||
graphics.Restore(state);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue