Tag: drawrectangle

在我的Paint程序中绘制矩形时出错

public partial class Form1 : Form { Point downPoint , upPoint; List shapes = new List(); public ShapesEnum shapeType; public Form1() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); foreach (var s in shapes) s.Draw(e.Graphics); } protected override void OnMouseDown(MouseEventArgs e) { downPoint = e.Location; } protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); […]