Exemple #1
0
 private void Draw2(BaseDll.Shape shape, Graphics gObject, Pen pen, bool xby)
 {
     if (xby)
     {
         gObject.DrawEllipse(pen, new Rectangle(shape.x1 - Math.Abs(shape.y1 - shape.y2), shape.y2, shape.width, shape.width));
     }
     else
     {
         gObject.DrawEllipse(pen, new Rectangle(shape.x2, shape.y1 - Math.Abs(shape.x1 - shape.x2), shape.width, shape.width));
     }
 }
Exemple #2
0
 private void Draw4(BaseDll.Shape shape, Graphics gObject, Pen pen, bool xby)
 {
     if (xby)
     {
         gObject.DrawEllipse(pen, new Rectangle(shape.x1, shape.y1, shape.width, shape.width));
     }
     else
     {
         gObject.DrawEllipse(pen, new Rectangle(shape.x1, shape.y1, shape.width, shape.width));
     }
 }
Exemple #3
0
 private bool CalcWidth(BaseDll.Shape shape)
 {
     if ((Math.Abs(shape.x1 - shape.x2) >= Math.Abs(shape.y2 - shape.y1)))
     {
         shape.width = Math.Abs(shape.y2 - shape.y1);
         return(true);
     }
     else
     {
         shape.width = Math.Abs(shape.x2 - shape.x1);
         return(false);
     }
 }
Exemple #4
0
        public override void Draw(BaseDll.Shape shape, Graphics gObject, Pen pen)
        {
            Point point1 = new Point(shape.x1, shape.y1);
            Point point2 = new Point(shape.x2, shape.y2);
            Point point3 = new Point(shape.x1, shape.y2);

            Point[] curvePoints =
            {
                point1,
                point2,
                point3,
            };
            gObject.DrawPolygon(pen, curvePoints);
        }
Exemple #5
0
 public override void Draw(BaseDll.Shape shape, Graphics gObject, Pen pen)
 {
     if (shape.x1 > shape.x2 && shape.y1 > shape.y2)
     {
         gObject.DrawRectangle(pen, new Rectangle(shape.x2, shape.y2, Math.Abs(shape.x1 - shape.x2), Math.Abs(shape.y1 - shape.y2)));
     }
     else if (shape.y1 > shape.y2 && shape.x1 < shape.x2)
     {
         gObject.DrawRectangle(pen, new Rectangle(shape.x1, shape.y2, Math.Abs(shape.x2 - shape.x1), Math.Abs(shape.y2 - shape.y1)));
     }
     else if (shape.x1 > shape.x2 && shape.y1 < shape.y2)
     {
         gObject.DrawRectangle(pen, new Rectangle(shape.x2, shape.y1, Math.Abs(shape.x2 - shape.x1), Math.Abs(shape.y2 - shape.y1)));
     }
     else
     {
         gObject.DrawRectangle(pen, new Rectangle(shape.x1, shape.y1, Math.Abs(shape.x2 - shape.x1), Math.Abs(shape.y2 - shape.y1)));
     }
 }
Exemple #6
0
        public override void Draw(BaseDll.Shape shape, Graphics gObject, Pen pen)
        {
            bool xby;

            xby = CalcWidth(shape);
            if (shape.x1 > shape.x2 && shape.y1 > shape.y2)
            {
                Draw2(shape, gObject, pen, xby);
            }
            else if (shape.y1 > shape.y2 && shape.x1 < shape.x2)
            {
                Draw1(shape, gObject, pen, xby);
            }
            else if (shape.x1 > shape.x2 && shape.y1 < shape.y2)
            {
                Draw3(shape, gObject, pen, xby);
            }
            else
            {
                Draw4(shape, gObject, pen, xby);
            }
        }
Exemple #7
0
 public virtual void Draw(BaseDll.Shape shape, Graphics gObject, Pen pen)
 {
 }
Exemple #8
0
 public override void Draw(BaseDll.Shape shape, Graphics gObject, Pen pen)
 {
     gObject.DrawLine(pen, shape.x1, shape.y1, shape.x2, shape.y2);
 }