private void DrawPolygon(Polygon polygon, DrawingStyle style, ViewInfo viewInfo, Graphics g) { if (style.StrokePen != null || style.FillBrush != null) { var p = viewInfo.RingToPointFList(polygon.ExteriorRing); var path = new GraphicsPath(FillMode.Winding); //Draw external ring path.AddPolygon(p); //Cut out inner polygons int numRings = polygon.InteriorRings.Count; for (int i = 0; i < numRings; i++) { p = viewInfo.RingToPointFList(polygon.InteriorRings[i]); path.AddPolygon(p); } if (style.FillBrush != null) { g.FillPath(style.FillBrush, path); } if (style.StrokePen != null) { g.DrawPath(style.StrokePen, path); } } }
private void DrawLineString(LineString line, DrawingStyle style, ViewInfo viewInfo, Graphics g) { if (style.StrokePen != null) { g.DrawLines(style.StrokePen, viewInfo.RingToPointFList(line.Vertices)); } }