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)); } }
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)); } }
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); } }
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); }
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))); } }
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); } }
public virtual void Draw(BaseDll.Shape shape, Graphics gObject, Pen pen) { }
public override void Draw(BaseDll.Shape shape, Graphics gObject, Pen pen) { gObject.DrawLine(pen, shape.x1, shape.y1, shape.x2, shape.y2); }