Beispiel #1
0
        public void Render(LittleSharpRenderEngine engine, Graphics graphics, IPolygon polygon, IAreaStyle style)
        {
            if (polygon == null || style == null)
            {
                return;
            }

            System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();

            gp.AddPolygon(RenderUtil.CoordToPoint(polygon.Shell.Coordinates));
            foreach (ILinearRing l in polygon.Holes)
            {
                gp.AddPolygon(RenderUtil.CoordToPoint(l.Coordinates));
            }
            gp.CloseFigure();

            if (style.Fill != null)
            {
                RenderUtil.RenderFill(engine, graphics, gp, style.Fill);
            }

            if (style.Outline != null)
            {
                RenderUtil.RenderOutline(engine, graphics, gp, style.Outline);
            }
        }
Beispiel #2
0
        public void Render(LittleSharpRenderEngine engine, Graphics graphics, ILineString line, ILineStyle style)
        {
            if (line == null || style == null)
            {
                return;
            }

            System.Drawing.Drawing2D.GraphicsPath gp = new System.Drawing.Drawing2D.GraphicsPath();
            //TODO: Does not seems to add a single long line, but multiple line segments
            gp.AddLines(RenderUtil.CoordToPoint(line.Coordinates));

            if (style.Outlines != null)
            {
                foreach (IOutline linestyle in style.Outlines)
                {
                    RenderUtil.RenderOutline(engine, graphics, gp, linestyle);
                }
            }
        }