I have written some code which creates a rounded rectangle GraphicsPath
, based on a custom structure, BorderRadius
(which allows me to define the t
"Is it possible to fill the inside of a GraphicsPath without using FillPath?"
Yes...but I think this is more of a parlor trick (and it might not work as you expect for more complex shapes). You can clip the graphics to the path, and then just fill the entire encompassing rectangle:
Rectangle rc = new Rectangle(10, 10, 100, 100);
GraphicsPath path = CreateRoundRectanglePath(new BorderRadius(8), rc);
e.Graphics.SetClip(path);
e.Graphics.FillRectangle(Brushes.Black, rc);
e.Graphics.ResetClip();