This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Draw a rectangle with round corner.

Dmitry.Obukhov#16684
Hello,

Unfortunately it is not possible to make a rectangle with rounded corners.
mzhao#16701
public RoundRectangleVObject(System.Drawing.RectangleF r, int d)
: base("roundrectangle")
{

// d = size of rounded corner
_path = new System.Drawing.Drawing2D.GraphicsPath();
_path.StartFigure();
_path.AddArc(r.X, r.Y, d, d, 180, 90);
_path.AddArc(r.X + r.Width - d, r.Y, d, d, 270, 90);
_path.AddArc(r.X + +r.Width - d, r.Y + r.Height-d, d, d, 360, 90);
_path.AddArc(r.X, r.Y + r.Height-d, d, d, 90, 90);

_path.CloseFigure();
}