public class Rectangle : Shape
{
protected Point m_Start;
protected Point m_End;
public Rectangle(Point start Point end Color fgColor)
{
m_Start = start;
m_End = end;
m_Color = fgColor;
}
public override void Draw(Form canvas)
{
if (canvas == null)
{
return;
}
InitializeGraphics(canvas);
Point startPoint = canvasPointToScreen(m_Start);
Point endPoint = canvasPointToScreen(m_End);
MainForm mainForm = (MainForm)canvas;
Color bgColor = GetBackgroundColor(m_Color);
Size rectSize = new Size(m_EndX m_StartX m_EndY m_StartY);
SystemDrawingRectangle rectToDraw = new SystemDrawingRectangle(startPoint rectSize);
ControlPaintDrawReversibleFrame(rectToDraw bgColor FrameStyleThick);
}
}