Check out example codes for "rounded rectangle in C#". It will help you in understanding the concepts better.

Code Example 1

// onpaint event for your control
protected override void OnPaint(PaintEventArgs e)
{
	Graphics g = e.Graphics;
  	g.SmoothingMode = SmoothingMode.HighQuality;
  	g.FillRoundedRectangle(g, Color.SkyBlue, 10, 10, Width - 10, Height - 10,
                          10, 10);
 	g.DrawRoundedRectangle(g, new Pen(new SolidBrush(Color.SkyBlue)), 0, 0,
                           Width, Height, 20, 20);
}

private void FillRoundedRectangle(Graphics g, Color c,
	int x, int y, int w, int h, int xr, int yr)
{
	GraphicsPath p = new GraphicsPath();
	p.AddArc(x, y, xr + xr, yr + yr, 180, 90);
	p.AddLine(x + xr, y, x + w - xr, y);
	p.AddArc(x + w - 2 * xr, y, 2 * xr, 2 * yr, 270, 90);
	p.AddLine(x + w, y + yr, x + w, y + h - yr);
	p.AddArc(x + w - 2 * xr, y + h - 2 * yr, xr + xr, yr + yr, 0, 95);
	p.AddLine(x + xr, y + h, x + w - xr, y + h);
	p.AddArc(x, y + h - 2 * yr, 2 * xr, 2 * yr, 90, 95);
	p.CloseFigure();
	g.FillPath(GetBrush(c), p);
}
private void FillRoundedRectangle(Graphics g, Brush b,
	int x, int y, int w, int h, int xr, int yr)
{
	GraphicsPath p = new GraphicsPath();
	p.AddArc(x, y, xr + xr, yr + yr, 180, 90);
	p.AddLine(x + xr, y, x + w - xr, y);
	p.AddArc(x + w - 2 * xr, y, 2 * xr, 2 * yr, 270, 90);
	p.AddLine(x + w, y + yr, x + w, y + h - yr);
	p.AddArc(x + w - 2 * xr, y + h - 2 * yr, xr + xr, yr + yr, 0, 95);
	p.AddLine(x + xr, y + h, x + w - xr, y + h);
	p.AddArc(x, y + h - 2 * yr, 2 * xr, 2 * yr, 90, 95);
	p.CloseFigure();
	g.FillPath(b, p);
}
private void DrawRoundedRectangle(Graphics g, Pen pn,
	int x, int y, int w, int h, int xr, int yr)
{
	GraphicsPath p = new GraphicsPath();
	p.AddArc(x, y, xr + xr, yr + yr, 180, 90);
	p.AddLine(x + xr, y, x + w - xr, y);
	p.AddArc(x + w - 2 * xr, y, 2 * xr, 2 * yr, 270, 90);
	p.AddLine(x + w, y + yr, x + w, y + h - yr);
	p.AddArc(x + w - 2 * xr, y + h - 2 * yr, xr + xr, yr + yr, 0, 95);
	p.AddLine(x + xr, y + h, x + w - xr, y + h);
	p.AddArc(x, y + h - 2 * yr, 2 * xr, 2 * yr, 90, 95);
	p.CloseFigure();
	g.DrawPath(pn, p);
}

Learn ReactJs, React Native from akashmittal.com