public Geometry CreateGeometry(Direct2DFactory factory) { PathGeometry geometry = factory.CreatePathGeometry(); //using (GeometrySink sink = geometry.Open()) //{ // sink.BeginFigure(Project(this._points[0]), FigureBegin.Hollow); // for (int index = 1; index < this._points.Length; ++index) // { // sink.AddLine(Project(this._points[index])); // } // sink.EndFigure(FigureEnd.Open); // sink.Close(); //} List <Geometry> list = new List <Geometry>(); //list.Add(geometry); for (int index = 0; index < _points.Length; ++index) { EllipseGeometry ellipse = factory.CreateEllipseGeometry(new Ellipse(Project(_points[index]), 5, 5)); list.Add(ellipse); } GeometryGroup group = factory.CreateGeometryGroup(FillMode.Winding, list.ToArray()); return(group); }
public Geometry CreateGeometry(Direct2DFactory factory) { PathGeometry geometry = factory.CreatePathGeometry(); using (GeometrySink sink = geometry.Open()) { sink.BeginFigure(_points[0], FigureBegin.Hollow); sink.AddLines(_points); sink.EndFigure(FigureEnd.Open); sink.Close(); } Geometry[] list = new Geometry[_points.Length + 1]; list[0] = geometry; for (int index = 0; index < _points.Length; ++index) { list[index + 1] = factory.CreateEllipseGeometry(new Ellipse(_points[index], 5, 5)); } GeometryGroup group = factory.CreateGeometryGroup(FillMode.Winding, list); return(group); }