mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Added step & speech balloon text shadow
This commit is contained in:
parent
a6192aa76a
commit
58a6707635
8 changed files with 48 additions and 5 deletions
|
@ -34,6 +34,11 @@ public class EllipseDrawingShape : BaseDrawingShape
|
|||
public override ShapeType ShapeType { get; } = ShapeType.DrawingEllipse;
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
DrawEllipse(g);
|
||||
}
|
||||
|
||||
protected void DrawEllipse(Graphics g)
|
||||
{
|
||||
if (Shadow && IsBorderVisible)
|
||||
{
|
||||
|
|
|
@ -108,6 +108,11 @@ public override void OnUpdate()
|
|||
}
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
DrawFreehand(g);
|
||||
}
|
||||
|
||||
protected void DrawFreehand(Graphics g)
|
||||
{
|
||||
if (Shadow)
|
||||
{
|
||||
|
|
|
@ -80,6 +80,11 @@ public bool OpenImageDialog(bool centerImage)
|
|||
}
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
DrawImage(g);
|
||||
}
|
||||
|
||||
protected void DrawImage(Graphics g)
|
||||
{
|
||||
if (Image != null)
|
||||
{
|
||||
|
|
|
@ -55,6 +55,11 @@ public override void OnUpdate()
|
|||
}
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
DrawLine(g);
|
||||
}
|
||||
|
||||
protected void DrawLine(Graphics g)
|
||||
{
|
||||
if (Shadow)
|
||||
{
|
||||
|
@ -64,7 +69,7 @@ public override void OnDraw(Graphics g)
|
|||
DrawLine(g, BorderColor, BorderSize, StartPosition, EndPosition, CenterPosition);
|
||||
}
|
||||
|
||||
protected virtual void DrawLine(Graphics g, Color borderColor, int borderSize, Point startPosition, Point endPosition, Point centerPosition)
|
||||
protected void DrawLine(Graphics g, Color borderColor, int borderSize, Point startPosition, Point endPosition, Point centerPosition)
|
||||
{
|
||||
if (borderSize > 0 && borderColor.A > 0)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,11 @@ public class RectangleDrawingShape : BaseDrawingShape
|
|||
public int CornerRadius { get; set; }
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
DrawRectangle(g);
|
||||
}
|
||||
|
||||
protected void DrawRectangle(Graphics g)
|
||||
{
|
||||
if (Shadow && IsBorderVisible)
|
||||
{
|
||||
|
|
|
@ -90,6 +90,11 @@ public override void Move(int x, int y)
|
|||
}
|
||||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
DrawSpeechBalloon(g);
|
||||
}
|
||||
|
||||
protected void DrawSpeechBalloon(Graphics g)
|
||||
{
|
||||
if (Rectangle.Width > 10 && Rectangle.Height > 10)
|
||||
{
|
||||
|
@ -164,7 +169,7 @@ public override void OnDraw(Graphics g)
|
|||
gpTail.Dispose();
|
||||
}
|
||||
|
||||
DrawText(g, Text, TextOptions.Color, TextOptions, Rectangle);
|
||||
DrawText(g);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,8 +71,12 @@ public override void OnConfigSave()
|
|||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
base.OnDraw(g);
|
||||
DrawEllipse(g);
|
||||
DrawNumber(g);
|
||||
}
|
||||
|
||||
protected void DrawNumber(Graphics g)
|
||||
{
|
||||
if (Shadow)
|
||||
{
|
||||
DrawNumber(g, Number, ShadowColor, Rectangle.LocationOffset(ShadowOffset));
|
||||
|
|
|
@ -56,14 +56,23 @@ public override void OnConfigSave()
|
|||
|
||||
public override void OnDraw(Graphics g)
|
||||
{
|
||||
base.OnDraw(g);
|
||||
DrawRectangle(g);
|
||||
DrawText(g);
|
||||
}
|
||||
|
||||
protected void DrawText(Graphics g)
|
||||
{
|
||||
if (Shadow)
|
||||
{
|
||||
DrawText(g, Text, ShadowColor, TextOptions, Rectangle.LocationOffset(ShadowOffset));
|
||||
}
|
||||
|
||||
DrawText(g, Text, TextOptions.Color, TextOptions, Rectangle);
|
||||
DrawText(g, Text, TextOptions, Rectangle);
|
||||
}
|
||||
|
||||
protected void DrawText(Graphics g, string text, TextDrawingOptions options, Rectangle rect)
|
||||
{
|
||||
DrawText(g, text, options.Color, options, rect);
|
||||
}
|
||||
|
||||
protected void DrawText(Graphics g, string text, Color textColor, TextDrawingOptions options, Rectangle rect)
|
||||
|
|
Loading…
Reference in a new issue