Example #1
0
        public override void Draw(InfoShape reactangle, Graphics g)
        {
            Point StartPoint  = reactangle.ListOfPoints[0];
            Point FinishPoint = reactangle.ListOfPoints[1];
            int   Width       = Math.Abs(StartPoint.X - FinishPoint.X);
            int   Height      = Math.Abs(StartPoint.Y - FinishPoint.Y);

            if (StartPoint.X < FinishPoint.X)
            {
                if (StartPoint.Y < FinishPoint.Y)
                {
                    g.DrawRectangle(new Pen(Color.Black), StartPoint.X, StartPoint.Y, Width, Height);
                }
                else
                {
                    g.DrawRectangle(new Pen(Color.Black), StartPoint.X, FinishPoint.Y, Width, Height);
                }
            }
            else
            {
                if (FinishPoint.Y < StartPoint.Y)
                {
                    g.DrawRectangle(new Pen(Color.Black), FinishPoint.X, FinishPoint.Y, Width, Height);
                }
                else
                {
                    g.DrawRectangle(new Pen(Color.Black), FinishPoint.X, StartPoint.Y, Width, Height);
                }
            }
        }
Example #2
0
        public override void Draw(InfoShape circle, Graphics g)
        {
            Point StartPoint  = circle.ListOfPoints[0];
            Point FinishPoint = circle.ListOfPoints[1];

            if (StartPoint.X < FinishPoint.X)
            {
                if (StartPoint.Y < FinishPoint.Y)
                {
                    g.DrawEllipse(new Pen(Color.Black), StartPoint.X, StartPoint.Y, FinishPoint.Y - StartPoint.Y, FinishPoint.Y - StartPoint.Y);
                }
                else
                {
                    g.DrawEllipse(new Pen(Color.Black), StartPoint.X, FinishPoint.Y, FinishPoint.X - StartPoint.X, FinishPoint.X - StartPoint.X);
                }
            }
            else
            {
                if (FinishPoint.Y < StartPoint.Y)
                {
                    g.DrawEllipse(new Pen(Color.Black), FinishPoint.X, FinishPoint.Y, StartPoint.Y - FinishPoint.Y, StartPoint.Y - FinishPoint.Y);
                }
                else
                {
                    g.DrawEllipse(new Pen(Color.Black), FinishPoint.X, StartPoint.Y, FinishPoint.Y - StartPoint.Y, FinishPoint.Y - StartPoint.Y);
                }
            }
        }
Example #3
0
        public override void Draw(InfoShape ellipse, Graphics g)
        {
            Point StartPoint  = ellipse.ListOfPoints[0];
            Point FinishPoint = ellipse.ListOfPoints[1];

            g.DrawEllipse(new Pen(Color.Black), StartPoint.X, StartPoint.Y, FinishPoint.X - StartPoint.X, FinishPoint.Y - StartPoint.Y);
        }
Example #4
0
        public override void Draw(InfoShape line, Graphics g)
        {
            Point StartPoint  = line.ListOfPoints[0];
            Point FinishPoint = line.ListOfPoints[1];

            g.DrawLine(new Pen(Color.Black), StartPoint, FinishPoint);
        }
Example #5
0
 public virtual void Draw(InfoShape shape, Graphics g)
 {
 }
Example #6
0
 public override void Draw(InfoShape triangle, Graphics g)
 {
     g.DrawPolygon(new Pen(Color.Black), triangle.ListOfPoints.ToArray());
 }