public override void Draw(Tekening tek, Graphics gr, bool widepen, bool fill) { IEnumerable <Point> ptn = punten.Select(T => tek.co_pt(T.Coordinaat, gr.DpiX, gr.DpiY)); Pen pen = (Pen)GetPen(false).Clone(); if (Geselecteerd) { Pen selectie = new Pen(Color.Black, pen.Width + 2); pen.Width += 1; gr.DrawCurve(selectie, ptn.ToArray(), tension); gr.DrawCurve(pen, ptn.ToArray(), tension); } else { if (widepen) { pen.Width += 2; pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Solid; } if (ptn.Count() >= 2) { gr.DrawCurve(pen, ptn.ToArray(), tension); } } }
public override void Draw(Tekening tek, Graphics gr, bool widepen, bool fill) { Point[] pt = punten.Select(T => tek.co_pt(T.Coordinaat, gr.DpiX, gr.DpiY)).ToArray(); if (pt.Length < 2) { return; } if (fill) { gr.FillPolygon(GetBrush(gr, tek.Schaal, tek.Offset, false), pt); } gr.DrawPolygon(GetPen(false), pt); }
public override void Draw(Graphics gr, float schaal, RectangleF window) { Pen pen = (Pen)GetPen(true).Clone(); pen.Width = pen.Width / 2.54f; if (Punten.Count == 2) { IEnumerable <PointF> p = punten.Select(T => new PointF(T.Coordinaat.X - window.Left, T.Coordinaat.Y - window.Top)); p = p.Select(T => new PointF(T.X * schaal * 10, T.Y * schaal * 10)); PointF pt1 = p.ElementAt(0); PointF pt2 = p.ElementAt(1); float r = (float)Math.Sqrt(Math.Pow(pt1.X - pt2.X, 2) + Math.Pow(pt1.Y - pt2.Y, 2)); gr.DrawFillEllipse(pen, GetBrush(gr, schaal, new PointF(), true), pt1.X - r, pt1.Y - r, 2 * r, 2 * r); } else if (punten.Count > 2) { PointF M; float straal; CalcCirkelWaarden(Punten[0].Coordinaat, Punten[1].Coordinaat, Punten[2].Coordinaat, out M, out straal); PointF Mtek = new PointF(M.X - window.Left, M.Y - window.Top); Mtek = new PointF(Mtek.X * schaal * 10, Mtek.Y * schaal * 10); straal = straal * schaal * 10; gr.DrawFillEllipse(pen, GetBrush(gr, schaal, new PointF(), true), Mtek.X - straal, Mtek.Y - straal, 2 * straal, 2 * straal); } }
public override string ToString() { return("boog;" + Zichtbaarheid + ";" + Niveau + ";" + Layer.Naam + ";" + ColorTranslator.ToOle(LijnKleur) + ";" + LijnDikte + ";" + (int)LijnStijl + ";" + (LijnStijl == DashStyle.Custom ? string.Join("/", DashPattern.Select(T => T.ToString()).ToArray()) : "") + ";" + string.Join(";", punten.Select(T => T.ID.ToString()).ToArray())); }
public override string ToString() { return("cirkelsegment;" + Zichtbaarheid + ";" + Niveau + ";" + Layer.Naam + ";" + ColorTranslator.ToOle(LijnKleur) + ";" + LijnDikte + ";" + (int)LijnStijl + ";" + ColorTranslator.ToOle(VulKleur1) + ";" + ColorTranslator.ToOle(VulKleur2) + ";" + (int)OpvulType + ";" + (int)VulStijl + ";" + LoopHoek + ";" + string.Join(";", punten.Select(T => T.ID.ToString()).ToArray())); }
public override void Draw(Graphics gr, bool widepen) { gr.DrawCurve(GetPen(false), punten.Select(T => T.Value).ToArray()); }
public override void Draw(Graphics gr, bool widepen) { gr.DrawPolygon(GetPen(false), punten.Select(T => T.Value).ToArray()); DrawGlyphs(gr); }