1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
| Procedure DrawRoundRect (G : System.Drawing.Graphics; Color, BorderColor : Color; R : Rectangle; X, Y : Integer); Var FSelectColor, FSelectBorderColor : System.Drawing.Color; Pen : System.Drawing.Pen; Brush : System.Drawing.Brush; GPath : System.Drawing.Drawing2D.GraphicsPath; Begin GPath := System.Drawing.Drawing2D.GraphicsPath.Create; GPath.AddArc(Rectangle.Create(R.Left, R.Top, X * 2, Y * 2),180, 90); GPath.AddLine(r.Left + X, r.Top, R.Right - X, r.Top);
GPath.AddArc(Rectangle.Create(r.Right - 2 * X - 1, R.Top, 2 * X, 2 * Y),270, 90); GPath.AddLine(r.Right - 1, r.Top + Y, r.Right - 1, r.Bottom - Y);
GPath.AddArc(r.Right - 2 * X - 1, r.Bottom - 2 * Y - 1, 2 * X, 2 * Y, 0, 90); GPath.AddLine(r.Right - X - 1, r.Bottom - 1, r.Left + X, r.Bottom - 1);
GPath.AddArc(r.Left, r.Bottom - 1 - 2 * Y, 2 * X, 2 * Y, 90,90); GPath.AddLine(r.Left, r.bottom - Y - 1, R.Left, r.Top + Y);
Pen := System.Drawing.Pen.Create (BorderColor, 1); Brush := System.Drawing.SolidBrush.Create(Color); G.FillPath(Brush, GPath); G.DrawPath(Pen, GPath); End; |