mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Added DrawCapsule extension
This commit is contained in:
parent
b916341d16
commit
8af932445b
1 changed files with 14 additions and 0 deletions
|
@ -73,6 +73,11 @@ public static void DrawRoundedRectangle(this Graphics g, Pen pen, Rectangle rect
|
|||
g.DrawRoundedRectangle(null, pen, rect, radius);
|
||||
}
|
||||
|
||||
public static void DrawRoundedRectangle(this Graphics g, Brush brush, Rectangle rect, float radius)
|
||||
{
|
||||
g.DrawRoundedRectangle(brush, null, rect, radius);
|
||||
}
|
||||
|
||||
public static void DrawRoundedRectangle(this Graphics g, Brush brush, Pen pen, Rectangle rect, float radius)
|
||||
{
|
||||
using (GraphicsPath gp = new GraphicsPath())
|
||||
|
@ -83,6 +88,15 @@ public static void DrawRoundedRectangle(this Graphics g, Brush brush, Pen pen, R
|
|||
}
|
||||
}
|
||||
|
||||
public static void DrawCapsule(this Graphics g, Brush brush, Rectangle rect)
|
||||
{
|
||||
using (GraphicsPath gp = new GraphicsPath())
|
||||
{
|
||||
gp.AddCapsule(rect);
|
||||
g.FillPath(brush, gp);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DrawRoundedRectangle(this Graphics g, Brush brush, Pen pen, int x, int y, int width, int height, float radius)
|
||||
{
|
||||
DrawRoundedRectangle(g, brush, pen, new Rectangle(x, y, width, height), radius);
|
||||
|
|
Loading…
Reference in a new issue