mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 22:21:23 +12:00
Render drawing shapes to result image
This commit is contained in:
parent
c69ca8cab7
commit
7a41290dad
|
@ -478,6 +478,12 @@ protected virtual void WriteTips(StringBuilder sb)
|
|||
if (AreaManager.CurrentShapeType == ShapeType.RegionDiamond) sb.Append("-> ");
|
||||
sb.AppendLine(Resources.RectangleRegion_WriteTips__Numpad_5__Diamond_shape);
|
||||
|
||||
//TODO: Translate
|
||||
if (AreaManager.CurrentShapeType == ShapeType.DrawingRectangle) sb.Append("-> ");
|
||||
sb.AppendLine("[Numpad 7] Rectangle drawing");
|
||||
if (AreaManager.CurrentShapeType == ShapeType.DrawingRoundedRectangle) sb.Append("-> ");
|
||||
sb.AppendLine("[Numpad 8] Rounded rectangle drawing");
|
||||
|
||||
switch (AreaManager.CurrentShapeType)
|
||||
{
|
||||
case ShapeType.RegionRoundedRectangle:
|
||||
|
@ -721,6 +727,25 @@ public void UpdateRegionPath()
|
|||
}
|
||||
}
|
||||
|
||||
public override Image GetResultImage()
|
||||
{
|
||||
if (SurfaceImage != null)
|
||||
{
|
||||
using (Graphics g = Graphics.FromImage(SurfaceImage))
|
||||
{
|
||||
foreach (BaseDrawingShape shape in AreaManager.DrawingShapes)
|
||||
{
|
||||
if (shape != null)
|
||||
{
|
||||
shape.Draw(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return base.GetResultImage();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (bmpSurfaceImage != null)
|
||||
|
|
|
@ -241,7 +241,7 @@ protected override void OnPaint(PaintEventArgs e)
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
public virtual Image GetRegionImage()
|
||||
public virtual Image GetResultImage()
|
||||
{
|
||||
return ShapeCaptureHelpers.GetRegionImage(SurfaceImage, regionFillPath, regionDrawPath, Config);
|
||||
}
|
||||
|
|
|
@ -2107,7 +2107,7 @@ private void CaptureRegion(CaptureType captureType, TaskSettings taskSettings, b
|
|||
{
|
||||
using (screenshot)
|
||||
{
|
||||
img = surface.GetRegionImage();
|
||||
img = surface.GetResultImage();
|
||||
|
||||
if (taskSettings.UploadSettings.RegionCaptureUseWindowPattern)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue