1 /// <summary>
2 /// Gets the path.
3 /// </summary>
4 /// <param name="rc">The rc.</param>
5 /// <param name="r">The radius for corner edges.</param>
6 /// <returns></returns>
7 private GraphicsPath GetPath(RectangleF rc, int r)
8 {
9
10 float x = rc.X, y = rc.Y, w = rc.Width, h = rc.Height;
11 GraphicsPath path = new GraphicsPath();
12 path.AddArc(x, y, r, r, 180, 90); //Upper left corner
13 path.AddArc(x + w - r, y, r, r, 270, 90); //Upper right corner
14 path.AddArc(x + w - r, y + h - r, r, r, 0, 90); //Lower right corner
15 path.AddArc(x, y + h - r, r, r, 90, 90); //Lower left corner
16 path.CloseFigure();
17 return path;
18 }