I experienced the same problem and found a solution. Might be too late for you @seriesOne but it can be useful to other people if they have this problem. Basically when using the fill methods (and also when setting the rounded rectangle as the clipping path with Graphics.SetClip) we have to move by one pixel the right and bottom lines. So I came up with a method that accepts a parameter to fix the rectangle is using the fill or not. Here it is:
private static GraphicsPath CreateRoundedRectangle(Rectangle b, int r, bool fill = false)
{
var path = new GraphicsPath();
var r2 = (int)r / 2;
var fix = fill ? 1 : 0;
b.Location = new Point(b.X - 1, b.Y - 1);
if (!fill)
b.Size = new Size(b.Width - 1, b.Height - 1);
path.AddArc(b.Left, b.Top, r, r, 180, 90);
path.AddLine(b.Left + r2, b.Top, b.Right - r2 - fix, b.Top);
path.AddArc(b.Right - r - fix, b.Top, r, r, 270, 90);
path.AddLine(b.Right, b.Top + r2, b.Right, b.Bottom - r2);
path.AddArc(b.Right - r - fix, b.Bottom - r - fix, r, r, 0, 90);
path.AddLine(b.Right - r2, b.Bottom, b.Left + r2, b.Bottom);
path.AddArc(b.Left, b.Bottom - r - fix, r, r, 90, 90);
path.AddLine(b.Left, b.Bottom - r2, b.Left, b.Top + r2);
return path;
}
So this is how you use it:
g.DrawPath(new Pen(Color.Red), CreateRoundedRectangle(rect, 24, false));
g.FillPath(new SolidBrush(Color.Red), CreateRoundedRectangle(rect, 24, true));