-
Rounded Rect
I used to use a rounded rectangle shape in C++, but I dont see anything like that in .NET. I've tried making my own using Lines and Bezier cuves, but the corners never seem to be the same shape (slightly off).
Does anything like this exist...any suggestions? I dont want to take the function out of an existing Windows DLL btw...
Thanks,
Steve
-
Im looking for this code too. Best i've found so far is GraphicsPath...
Graphics g = e.Graphics;
GraphicsPath gp = new GraphicsPath();
gp.AddLine(x + radius, y, x + width - radius, y);
gp.AddArc(x + width - radius, y, radius, radius, 270, 90);
gp.AddLine(x + width, y + radius, x + width, y + height - radius);
gp.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90);
gp.AddLine(x + width - radius, y + height, x + radius, y + height);
gp.AddArc(x, y + height - radius, radius, radius, 90, 90);
gp.AddLine(x, y + height - radius, x, y + radius);
gp.AddArc(x, y, radius, radius, 180, 90);
gp.CloseFigure();
But i need to draw a lot of these and i don't want to create a new path for each one. Anyone have a better solution?
-
Hmm, its really weird that .Net doesnt have a basic function like RounderRect. If anyone know a solution to this problem please let us know.
/Anders
-