mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Give previous result to DrawOutput instead of SurfaceImage so effects can be applied to top of each other
This commit is contained in:
parent
d7d65a3946
commit
431b733fae
5 changed files with 18 additions and 11 deletions
|
@ -686,22 +686,29 @@ public void UpdateRegionPath()
|
|||
|
||||
public override Image GetResultImage()
|
||||
{
|
||||
if (SurfaceImage != null && AreaManager.DrawingShapes.Length > 0)
|
||||
if (SurfaceImage != null)
|
||||
{
|
||||
using (Bitmap surfaceCopy = (Bitmap)SurfaceImage.Clone())
|
||||
using (Graphics g = Graphics.FromImage(SurfaceImage))
|
||||
if (AreaManager.DrawingShapes.Length > 0)
|
||||
{
|
||||
foreach (BaseDrawingShape shape in AreaManager.DrawingShapes)
|
||||
using (Bitmap bmp = new Bitmap(SurfaceImage))
|
||||
using (Graphics g = Graphics.FromImage(bmp))
|
||||
{
|
||||
if (shape != null)
|
||||
foreach (BaseDrawingShape shape in AreaManager.DrawingShapes)
|
||||
{
|
||||
shape.DrawOutput(g, surfaceCopy);
|
||||
if (shape != null)
|
||||
{
|
||||
shape.DrawOutput(g, bmp);
|
||||
}
|
||||
}
|
||||
|
||||
return ShapeCaptureHelpers.GetRegionImage(bmp, regionFillPath, regionDrawPath, Config);
|
||||
}
|
||||
}
|
||||
|
||||
return ShapeCaptureHelpers.GetRegionImage(SurfaceImage, regionFillPath, regionDrawPath, Config);
|
||||
}
|
||||
|
||||
return base.GetResultImage();
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
|
|
|
@ -34,7 +34,7 @@ public static class ShapeCaptureHelpers
|
|||
{
|
||||
public static Image GetRegionImage(Image surfaceImage, GraphicsPath regionFillPath, GraphicsPath regionDrawPath, SurfaceOptions options)
|
||||
{
|
||||
if (regionFillPath != null)
|
||||
if (surfaceImage != null && regionFillPath != null)
|
||||
{
|
||||
Image img;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public override void Draw(Graphics g)
|
|||
|
||||
if (Rectangle.Width > 10 && Rectangle.Height > 10)
|
||||
{
|
||||
using (Font font = new Font("Verdana", 12, FontStyle.Bold))
|
||||
using (Font font = new Font("Verdana", 14))
|
||||
using (StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center })
|
||||
{
|
||||
g.DrawString("Blur", font, Brushes.White, Rectangle, sf);
|
||||
|
|
|
@ -47,7 +47,7 @@ public override void Draw(Graphics g)
|
|||
|
||||
if (Rectangle.Width > 10 && Rectangle.Height > 10)
|
||||
{
|
||||
using (Font font = new Font("Verdana", 12, FontStyle.Bold))
|
||||
using (Font font = new Font("Verdana", 14))
|
||||
using (StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center })
|
||||
{
|
||||
g.DrawString("Highlight", font, Brushes.Black, Rectangle, sf);
|
||||
|
|
|
@ -49,7 +49,7 @@ public override void Draw(Graphics g)
|
|||
|
||||
if (Rectangle.Width > 10 && Rectangle.Height > 10)
|
||||
{
|
||||
using (Font font = new Font("Verdana", 12, FontStyle.Bold))
|
||||
using (Font font = new Font("Verdana", 14))
|
||||
using (StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center })
|
||||
{
|
||||
g.DrawString("Pixelate", font, Brushes.White, Rectangle, sf);
|
||||
|
|
Loading…
Reference in a new issue