Getting Rounded Edged Corner Graphics Path

public static GraphicsPath GetRoundPath(Rectangle r, int depth)
      {
          GraphicsPath graphPath = new GraphicsPath();

          graphPath.AddArc(r.X, r.Y, depth, depth, 180, 90);
          graphPath.AddArc(r.X + r.Width - depth, r.Y, depth, depth, 270, 90);
          graphPath.AddArc(r.X + r.Width - depth, r.Y + r.Height - depth, depth, depth, 0, 90);
          graphPath.AddArc(r.X, r.Y + r.Height - depth, depth, depth, 90, 90);
          graphPath.AddLine(r.X, r.Y + r.Height - depth, r.X, r.Y + depth / 2);
          
          return graphPath;
      }
posted @ 2012-04-01 14:38  sandeepparekh9  阅读(147)  评论(0)    收藏  举报