public override void AddShape(WpfPoint point, WpfStreamGeometryContext sgc) { var x1 = point.X - Size / 2f; var x2 = point.X - Size / 4f; var x3 = point.X + Size / 4f; var x4 = point.X + Size / 2f; var y1 = point.Y - Size / 2f; var y2 = point.Y - Size / 4f; var y3 = point.Y + Size / 4f; var y4 = point.Y + Size / 2f; sgc.BeginFigure(new WpfPoint(x2, y1), true, true); sgc.PolyLineTo(new List <WpfPoint>(new[] { new WpfPoint(x3, y1), new WpfPoint(x3, y2), new WpfPoint(x4, y2), new WpfPoint(x4, y3), new WpfPoint(x3, y3), new WpfPoint(x3, y4), new WpfPoint(x2, y4), new WpfPoint(x2, y3), new WpfPoint(x1, y3), new WpfPoint(x1, y2), new WpfPoint(x2, y2), new WpfPoint(x2, y1) }), true, true); }
private void AddShape(WpfStreamGeometryContext sgc, ILinearRing linearRing, bool filled) { var coords = linearRing.Coordinates; WpfPoint[] wpfPoints; var startPoint = TransformSequence(coords, out wpfPoints); sgc.BeginFigure(startPoint, filled, true); sgc.PolyLineTo(wpfPoints, true, true); }
public override void AddShape(WpfPoint point, WpfStreamGeometryContext sgc) { var start = new WpfPoint(point.X, (point.Y - Size / 2)); var linesTo = new List <WpfPoint>( new[] { new WpfPoint((point.X + Size / 2), (point.Y + Size / 2)), new WpfPoint((point.X - Size / 2), (point.Y + Size / 2)), new WpfPoint((point.X), (point.Y - Size / 2)) }); sgc.BeginFigure(start, true, true); sgc.PolyLineTo(linesTo, true, true); }
public override void AddShape(WpfPoint point, WpfStreamGeometryContext sgc) { var start = new WpfPoint(point.X - 0.5 * Size, point.Y - 0.5 * Size); var polylineTo = new List <WpfPoint>(new[] { new WpfPoint(point.X + 0.5 * Size, point.Y - 0.5 * Size), new WpfPoint(point.X + 0.5 * Size, point.Y + 0.5 * Size), new WpfPoint(point.X - 0.5 * Size, point.Y + 0.5 * Size), start }); sgc.BeginFigure(start, true, true); sgc.PolyLineTo(polylineTo, true, true); }
public override void AddShape(WpfPoint point, WpfStreamGeometryContext sgc) { sgc.BeginFigure(new WpfPoint((point.X), (point.Y - Size * 1 / 8)), true, true); sgc.PolyLineTo(new List <WpfPoint>(new[] { new WpfPoint((point.X + Size * 2 / 8), (point.Y - Size / 2)), new WpfPoint((point.X + Size / 2), (point.Y - Size / 2)), new WpfPoint((point.X + Size * 1 / 8), (point.Y)), new WpfPoint((point.X + Size / 2), (point.Y + Size / 2)), new WpfPoint((point.X + Size * 2 / 8), (point.Y + Size / 2)), new WpfPoint((point.X), (point.Y + Size * 1 / 8)), new WpfPoint((point.X - Size * 2 / 8), (point.Y + Size / 2)), new WpfPoint((point.X - Size / 2), (point.Y + Size / 2)), new WpfPoint((point.X - Size * 1 / 8), (point.Y)), new WpfPoint((point.X - Size / 2), (point.Y - Size / 2)), new WpfPoint((point.X - Size * 2 / 8), (point.Y - Size / 2)) }), true, true); }
public System.Windows.Media.Geometry GetCaptureShape() { System.Windows.Media.StreamGeometry geo = new System.Windows.Media.StreamGeometry(); System.Windows.Media.StreamGeometryContext ctx = geo.Open(); System.Collections.ObjectModel.ReadOnlyCollection <System.Drawing.Point> points = _shape.Points; List <System.Windows.Point> mPoints = new List <System.Windows.Point>(); foreach (Point p in points) { mPoints.Add(new System.Windows.Point(p.X, p.Y)); } if (mPoints.Count > 0) { //mPoints.Add(mPoints[0]); ctx.BeginFigure(mPoints[0], false, false); ctx.PolyLineTo(mPoints, true, false); } ctx.Close(); return(geo); }
private void AddShape(WpfStreamGeometryContext sgc, ILinearRing linearRing, bool filled) { var coords = linearRing.Coordinates; WpfPoint[] wpfPoints; var startPoint = TransformSequence(coords, out wpfPoints); sgc.BeginFigure(startPoint, filled, true); sgc.PolyLineTo(wpfPoints, true, true); }
public override void AddShape(WpfPoint point, WpfStreamGeometryContext sgc) { sgc.BeginFigure(new WpfPoint((point.X), (point.Y - Size * 1 / 8)), true, true); sgc.PolyLineTo(new List<WpfPoint>(new[] { new WpfPoint((point.X + Size*2/8), (point.Y - Size/2)), new WpfPoint((point.X + Size/2), (point.Y - Size/2)), new WpfPoint((point.X + Size*1/8), (point.Y)), new WpfPoint((point.X + Size/2), (point.Y + Size/2)), new WpfPoint((point.X + Size*2/8), (point.Y + Size/2)), new WpfPoint((point.X), (point.Y + Size*1/8)), new WpfPoint((point.X - Size*2/8), (point.Y + Size/2)), new WpfPoint((point.X - Size/2), (point.Y + Size/2)), new WpfPoint((point.X - Size*1/8), (point.Y)), new WpfPoint((point.X - Size/2), (point.Y - Size/2)), new WpfPoint((point.X - Size*2/8), (point.Y - Size/2)) }), true, true); }
public override void AddShape(WpfPoint point, WpfStreamGeometryContext sgc) { var x1 = point.X - Size / 2f; var x2 = point.X - Size / 4f; var x3 = point.X + Size / 4f; var x4 = point.X + Size / 2f; var y1 = point.Y - Size / 2f; var y2 = point.Y - Size / 4f; var y3 = point.Y + Size / 4f; var y4 = point.Y + Size / 2f; sgc.BeginFigure(new WpfPoint(x2, y1), true, true); sgc.PolyLineTo(new List<WpfPoint>(new[] { new WpfPoint(x3, y1), new WpfPoint(x3, y2), new WpfPoint(x4, y2), new WpfPoint(x4, y3), new WpfPoint(x3, y3), new WpfPoint(x3, y4), new WpfPoint(x2, y4), new WpfPoint(x2, y3), new WpfPoint(x1, y3), new WpfPoint(x1, y2), new WpfPoint(x2, y2), new WpfPoint(x2, y1) }), true, true); }
public override void AddShape(WpfPoint point, WpfStreamGeometryContext sgc) { var start = new WpfPoint(point.X, (point.Y - Size / 2)); var linesTo = new List<WpfPoint>( new[] { new WpfPoint((point.X + Size/2), (point.Y + Size/2)), new WpfPoint((point.X - Size/2), (point.Y + Size/2)), new WpfPoint((point.X), (point.Y - Size/2)) }); sgc.BeginFigure(start, true, true); sgc.PolyLineTo(linesTo, true, true); }
public override void AddShape(WpfPoint point, WpfStreamGeometryContext sgc) { var start = new WpfPoint(point.X - 0.5 * Size, point.Y - 0.5 * Size); var polylineTo = new List<WpfPoint>(new[] { new WpfPoint(point.X + 0.5*Size, point.Y - 0.5*Size), new WpfPoint(point.X + 0.5*Size, point.Y + 0.5*Size), new WpfPoint(point.X - 0.5*Size, point.Y + 0.5*Size), start }); sgc.BeginFigure(start, true, true); sgc.PolyLineTo(polylineTo, true, true); }