public class Rectangle : Shape
{
protected Point m_Start;
protected Point m_End;
public Rectangle(Point start
{
m_Start = start;
m_End = end;
m_Color = fgColor;
}
public override void Draw(Form canvas)
{
if (canvas == null)
{
return;
}
InitializeGraphics(canvas);
Point startPoint = canvas
Point endPoint = canvas
MainForm mainForm = (MainForm)canvas;
Color bgColor = GetBackgroundColor(m_Color);
Size rectSize = new Size(m_End
System
ControlPaint
}
}
From:http://tw.wingwit.com/Article/program/net/201311/13468.html