Exemplo n.º 1
0
        /// <summary>
        /// Function to symbolize the graphics path to the graphics object
        /// </summary>
        /// <param name="g">The graphics object</param>
        /// <param name="paths">The paths</param>
        public void SymbolizePaths(Graphics g, IEnumerable <GraphicsPath> paths)
        {
            foreach (var graphicsPath in paths)
            {
                var clonedPattern = (GraphicsPath)Pattern.Clone();
                var warpedPath    = WarpPathToPath.Warp(graphicsPath, clonedPattern, true, Interval);

                if (warpedPath == null)
                {
                    continue;
                }

                if (Fill != null)
                {
                    g.FillPath(Fill, warpedPath);
                }
                if (Line != null)
                {
                    g.DrawPath(Line, warpedPath);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Function that actually renders the linestring
        /// </summary>
        /// <param name="map">The map</param>
        /// <param name="lineString">The line string to symbolize.</param>
        /// <param name="graphics">The graphics</param>
        protected override void OnRenderInternal(MapViewport map, ILineString lineString, Graphics graphics)
        {
            var clonedPattern = (GraphicsPath)Pattern.Clone();
            var graphicsPath  = WarpPathToPath.Warp(LineStringToPath(lineString, map), clonedPattern, true, Interval);

            if (graphicsPath == null)
            {
                return;
            }

            // Fill?
            if (Fill != null)
            {
                graphics.FillPath(Fill, graphicsPath);
            }

            // Outline
            if (Line != null)
            {
                graphics.DrawPath(Line, graphicsPath);
            }
        }