WinForm------PanelControl控件中使用Pen类画角圆矩形方法

private void rightPanel_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen p = new Pen(Color.FromArgb(,,,));
p.Width = ;
DrawRoundRect(g, p, + nowPicture * , , , , );
} public void DrawRoundRect(Graphics g, Pen p, float X, float Y, float width, float height, float radius)
{
  GraphicsPath gp = new GraphicsPath();   gp.AddLine(X + radius, Y, X + width - (radius * ), Y);
  
  gp.AddArc(X + width - (radius * ), Y, radius * , radius * , , );   gp.AddLine(X + width, Y + radius, X + width, Y + height - (radius * ));   gp.AddArc(X + width - (radius * ), Y + height - (radius * ), radius * , radius * , , );   gp.AddLine(X + width - (radius * ), Y + height, X + radius, Y + height);   gp.AddArc(X, Y + height - (radius * ), radius * , radius * , , );   gp.AddLine(X, Y + height - (radius * ), X, Y + radius);   gp.AddArc(X, Y, radius * , radius * , , );   gp.CloseFigure();   g.DrawPath(p, gp);
  gp.Dispose();
}
上一篇:sql server top 10 IO性能查询


下一篇:reactjs学习一(环境搭配react+es6+webpack热部署)