Example #1
0
 public HyperbolTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
     a     = 20;
     b     = 15;
     left  = new List <Point>();
     right = new List <Point>();
 }
Example #2
0
        public override void drawWithAngle(ToolSettings toolsettings)
        {
            Point mid = new Point(0, 0);

            mid.X = (startPoint.X + endPoint.X) / 2;
            mid.Y = (startPoint.Y + endPoint.Y) / 2;

            drawWithAngle(toolsettings, mid);
        }
Example #3
0
        public virtual void drawControlPointToSelectShape(ToolSettings toolSettings, int sizeControlPoint)
        {
            List <Point> control = getControlPoint();
            Pen          pen     = new Pen(Color.Red, sizeControlPoint);

            foreach (Point point in control)
            {
                Graphics.FromImage(toolSettings.bitmap).DrawRectangle(pen, point.X, point.Y, sizeControlPoint, sizeControlPoint);
            }
        }
Example #4
0
        public override void drawWithAngle(ToolSettings toolsettings)
        {
            Point        mid          = new Point(0, 0);
            List <Point> controlPoint = getControlPoint();

            foreach (var p in controlPoint)
            {
                mid.X += p.X;
                mid.Y += p.Y;
            }
            mid.X /= controlPoint.Count;
            mid.Y /= controlPoint.Count;

            drawWithAngle(toolsettings, mid);
        }
Example #5
0
        public override void drawWithAngle(ToolSettings toolsettings)
        {
            Point mid = new Point(0, 0);

            xMin = (int)polyPoint.Min(point => point.X);
            yMin = (int)polyPoint.Min(point => point.Y);

            xMax = (int)polyPoint.Max(point => point.X);
            yMax = (int)polyPoint.Max(point => point.Y);

            mid.X = (xMin + xMax) / 2;
            mid.Y = (yMin + yMax) / 2;

            drawWithAngle(toolsettings, mid);
        }
Example #6
0
        public override void drawAllPointToShape(ToolSettings toolSettings, int sizeControlPoint)
        {
            base.drawAllPointToShape(toolSettings, sizeControlPoint);
            List <Point> pointRect = ParallelogramTool.get4PointRectangleFrom2Point(startPoint, endPoint);

            pointRect = ParallelogramTool.get4PointParallelogramFromRectangle(pointRect, alpha);
            Point point = new Point(pointRect[1].X, pointRect[1].Y);

            point = rotatePoint(point, angleIn, getMid());

            Pen pen = new Pen(Color.Yellow, sizeControlPoint);

            Graphics.FromImage(toolSettings.bitmap).DrawRectangle(pen, point.X, point.Y, sizeControlPoint, sizeControlPoint);
            toolSettings.pictureBox.Invalidate();
        }
Example #7
0
        public override void drawWithAngle(ToolSettings toolsettings, Point p)
        {
            Matrix matrix = new Matrix();

            matrix.RotateAt((float)(angleIn), p);
            Graphics g = Graphics.FromImage(toolsettings.bitmap);

            g.Transform = matrix;

            Pen pen = new Pen(new SolidBrush(outlineColor), width);

            pen.DashStyle = lineStyle;

            g.SmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;

            List <PointF> tempLeft = new List <PointF>();

            for (int i = 0; i < polyPoint.Count / 2 - 2; i++)
            {
                tempLeft.Add(polyPoint[i]);
            }
            //draw
            if (polyPoint.Count > 2)
            {
                g.DrawLines(pen, tempLeft.ToArray());
            }
            List <PointF> tempRight = new List <PointF>();

            for (int i = polyPoint.Count / 2 + 2; i < polyPoint.Count; i++)
            {
                tempRight.Add(polyPoint[i]);
            }
            //draw
            if (polyPoint.Count > 2)
            {
                g.DrawLines(pen, tempRight.ToArray());
            }

            toolsettings.pictureBox.Invalidate();


            matrix.RotateAt(-(float)(angleIn), p);
            g.Transform = matrix;
        }
Example #8
0
        public override void drawWithAngle(ToolSettings toolsettings)
        {
            Matrix matrix = new Matrix();

            matrix.RotateAt((float)(angleIn), coord);
            Graphics g = Graphics.FromImage(toolsettings.bitmap);

            g.Transform = matrix;

            g.SmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;

            g.DrawString(text, font, new SolidBrush(outlineColor), coord);
            toolsettings.pictureBox.Invalidate();


            matrix.RotateAt(-(float)(angleIn), coord);
            g.Transform = matrix;
        }
Example #9
0
 public abstract void rotateAndDraw(List <Point> controlPoint, Point startMouse, Point pointCurrent, ToolSettings toolsettings);
Example #10
0
 public EllipseTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
 }
Example #11
0
 public Tool(ToolSettings args)
 {
     this.toolSetting = args;
 }
Example #12
0
 public TextTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
     toolSetting.pictureBox.Cursor = Cursors.Cross;
 }
Example #13
0
 public CircleTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
 }
Example #14
0
 public EraseTool(ToolSettings args)
     : base(args)
 {
     args.pictureBox.Cursor = Cursors.Hand;
 }
Example #15
0
 public abstract void drawWithAngle(ToolSettings toolsettings, Point p);
Example #16
0
 public BezierTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
     polyPoint = new List <Point>();
 }
Example #17
0
 public SelectTool(ToolSettings args)
     : base(args)
 {
     args.pictureBox.Cursor = Cursors.Arrow;
 }
Example #18
0
 public override void drawWithAngle(ToolSettings toolsettings, Point p)
 {
 }
Example #19
0
 public RectangleTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
     drawing = false;
     toolSettings.pictureBox.Cursor = Cursors.Cross;
 }
Example #20
0
 public virtual void drawAllPointToShape(ToolSettings toolSettings, int sizeControlPoint)
 {
     drawControlPointToSelectShape(toolSettings, sizeControlPoint);
     drawRotatePointToSelectShape(toolSettings, sizeControlPoint, Color.Green);
 }
Example #21
0
 public ParabolTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
 }
Example #22
0
 public override void rotateAndDraw(List <Point> controlPoint, Point startMouse, Point pointCurrent, ToolSettings toolsettings)
 {
     angleIn  = pointCurrent.X - startMouse.X;
     angleIn %= 360;
     drawWithAngle(toolsettings);
 }
Example #23
0
 public ParallelogramTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
     pointRect = new List <Point>();
     alpha     = -50;
 }
Example #24
0
 public FillTool(ToolSettings args)
     : base(args)
 {
     args.pictureBox.Cursor = Cursors.IBeam;
 }
Example #25
0
 public ArcEllipseTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
     alpha = 0;
 }
Example #26
0
 public PolylineTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
     polyPoint = new List <Point>();
 }
Example #27
0
 public ArcCircleTool(ToolSettings toolSettings)
     : base(toolSettings)
 {
     alpha = 0;
 }