|
-
July 27th, 2002, 07:58 PM
#1
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
-
September 9th, 2002, 11:46 PM
#2
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?
-
October 23rd, 2003, 07:27 AM
#3
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
-
October 23rd, 2003, 10:34 AM
#4
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|