public HyperbolTool(ToolSettings toolSettings) : base(toolSettings) { a = 20; b = 15; left = new List <Point>(); right = new List <Point>(); }
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); }
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); } }
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); }
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); }
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(); }
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; }
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; }
public abstract void rotateAndDraw(List <Point> controlPoint, Point startMouse, Point pointCurrent, ToolSettings toolsettings);
public EllipseTool(ToolSettings toolSettings) : base(toolSettings) { }
public Tool(ToolSettings args) { this.toolSetting = args; }
public TextTool(ToolSettings toolSettings) : base(toolSettings) { toolSetting.pictureBox.Cursor = Cursors.Cross; }
public CircleTool(ToolSettings toolSettings) : base(toolSettings) { }
public EraseTool(ToolSettings args) : base(args) { args.pictureBox.Cursor = Cursors.Hand; }
public abstract void drawWithAngle(ToolSettings toolsettings, Point p);
public BezierTool(ToolSettings toolSettings) : base(toolSettings) { polyPoint = new List <Point>(); }
public SelectTool(ToolSettings args) : base(args) { args.pictureBox.Cursor = Cursors.Arrow; }
public override void drawWithAngle(ToolSettings toolsettings, Point p) { }
public RectangleTool(ToolSettings toolSettings) : base(toolSettings) { drawing = false; toolSettings.pictureBox.Cursor = Cursors.Cross; }
public virtual void drawAllPointToShape(ToolSettings toolSettings, int sizeControlPoint) { drawControlPointToSelectShape(toolSettings, sizeControlPoint); drawRotatePointToSelectShape(toolSettings, sizeControlPoint, Color.Green); }
public ParabolTool(ToolSettings toolSettings) : base(toolSettings) { }
public override void rotateAndDraw(List <Point> controlPoint, Point startMouse, Point pointCurrent, ToolSettings toolsettings) { angleIn = pointCurrent.X - startMouse.X; angleIn %= 360; drawWithAngle(toolsettings); }
public ParallelogramTool(ToolSettings toolSettings) : base(toolSettings) { pointRect = new List <Point>(); alpha = -50; }
public FillTool(ToolSettings args) : base(args) { args.pictureBox.Cursor = Cursors.IBeam; }
public ArcEllipseTool(ToolSettings toolSettings) : base(toolSettings) { alpha = 0; }
public PolylineTool(ToolSettings toolSettings) : base(toolSettings) { polyPoint = new List <Point>(); }
public ArcCircleTool(ToolSettings toolSettings) : base(toolSettings) { alpha = 0; }