I am drawing an arc to a GraphicsPath object using code similar to this:
path.AddArc(r, 270,90);
As expected, when I render this GraphicsPath object to the screen I get an arc that looks like this:

What I want to be able to do is add another arc just inside this one, as well as lines to complete a single figure. When rendered it would look like this:

Basically, another arc rendered inside the first, of some thickness/offset, and then have the endpoints connected via a line to form a single figure. I'm sure this can't be as difficult as I am making it, but I sure can't find any example of people doing this before. Thanks,
Todd

Sandhiya PriyaRank #26 · 43.2K reputationPosted Oct 27, 2025, 5:14 AM EDT
you’re exactly right: this is actually a common graphics geometry problem in GDI+ (System.Drawing) — you want to draw a thick, ring-like arc (essentially a sector of a donut).
Let’s walk through how to do this step-by-step.
Goal
You have something like:
GraphicsPath path = new GraphicsPath(); path.AddArc(r, 270, 90);Now you want:
Another arc inside (smaller radius).
Lines at the endpoints connecting the outer and inner arcs.
A single closed shape (so you can fill it or outline it).
1. Core Concept
To create that ring-like shape, you:
Define two rectangles:
outerRectfor the outer arc.innerRectfor the inner arc, slightly smaller.Add the outer arc (clockwise).
Add the inner arc (counter-clockwise).
Close the figure (to connect endpoints).
2. Working Example
Here’s a complete snippet:
using System; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows.Forms; public class ArcForm : Form { protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; // Outer arc rectangle Rectangle outerRect = new Rectangle(50, 50, 200, 200); // Inner arc rectangle (smaller by offset) int offset = 20; Rectangle innerRect = new Rectangle( outerRect.X + offset, outerRect.Y + offset, outerRect.Width - 2 * offset, outerRect.Height - 2 * offset ); float startAngle = 270; float sweepAngle = 90; using (GraphicsPath path = new GraphicsPath()) { // Outer arc (clockwise) path.AddArc(outerRect, startAngle, sweepAngle); // Inner arc (counter-clockwise) path.AddArc(innerRect, startAngle + sweepAngle, -sweepAngle); // Close the figure (connect endpoints) path.CloseFigure(); // Optional fill or outline e.Graphics.FillPath(Brushes.SkyBlue, path); e.Graphics.DrawPath(Pens.Navy, path); } } [STAThread] public static void Main() { Application.Run(new ArcForm()); } }Explanation
Variations
To create a different thickness, adjust
offset.To create multiple ring segments, just repeat with different start/sweep angles.
You can use
GraphicsPath.AddPie()if you want the inner radius = 0 (a wedge).Bonus Tip: Draw “bordered arcs” easily
If you only need an outline, not a filled area:
Pen thickPen = new Pen(Color.Blue, 20); e.Graphics.DrawArc(thickPen, outerRect, 270, 90);But that gives you a stroked path (not a filled band).
The method above (two arcs + fill) gives full shape control.
Muhammad Bilal Jack16 reputationPosted Oct 27, 2025, 3:26 PM EDT
Good question to the Vip Youcinesuggests using SVG paths with shared endpoints to connect the two arcs.
Muhammad Bilal Jack16 reputationPosted Oct 27, 2025, 3:28 PM EDT
Good question to theVip Youcine suggests using SVG paths with shared endpoints to connect the two arcs.