当前位置: 首页>>代码示例>>C#>>正文


C# ILineString.TransformToImage方法代码示例

本文整理汇总了C#中ILineString.TransformToImage方法的典型用法代码示例。如果您正苦于以下问题:C# ILineString.TransformToImage方法的具体用法?C# ILineString.TransformToImage怎么用?C# ILineString.TransformToImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILineString的用法示例。


在下文中一共展示了ILineString.TransformToImage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DrawLineString

        /// <summary>
        /// Renders a LineString to the map.
        /// </summary>
        /// <param name="g">IGraphics reference</param>
        /// <param name="line">LineString to render</param>
        /// <param name="pen">Pen style used for rendering</param>
        /// <param name="map">Map reference</param>
        /// <param name="offset">Offset by which line will be moved to right</param>
        public void DrawLineString(IGraphics g, ILineString line, Pen pen, Map map, float offset)
        {
            var points = line.TransformToImage(map);
            if (points.Length > 1)
            {
                var gp = new GraphicsPath();
                if (offset != 0d)
                    points = RendererHelper.OffsetRight(points, offset);
                gp.AddLines(/*LimitValues(*/points/*, ExtremeValueLimit)*/);

                g.DrawPath(pen, gp);
            }
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:21,代码来源:VectorRenderer.cs

示例2: OnRenderInternal

 /// <summary>
 /// Method that does the actual rendering of individual features.
 /// </summary>
 /// <param name="map">The map</param>
 /// <param name="lineString">The linestring</param>
 /// <param name="graphics">The graphics object</param>
 protected override void OnRenderInternal(Map map, ILineString lineString, Graphics graphics)
 {
     var pts = /*LimitValues(*/ VectorRenderer.OffsetRight(lineString.TransformToImage(map), Offset) /*)*/;
     graphics.DrawLines(Line, pts);
 }
开发者ID:geobabbler,项目名称:SharpMap,代码行数:11,代码来源:BasicLineSymbolizer.cs

示例3: LineStringToPath

 /// <summary>
 /// Function to transform a linestring to a graphics path for further processing
 /// </summary>
 /// <param name="lineString">The Linestring</param>
 /// <param name="map">The map</param>
 /// <!--<param name="useClipping">A value indicating whether clipping should be applied or not</param>-->
 /// <returns>A GraphicsPath</returns>
 public static GraphicsPath LineStringToPath(ILineString lineString, Map map)
 {
     var gp = new GraphicsPath(FillMode.Alternate);
     gp.AddLines(lineString.TransformToImage(map));
     return gp;
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:13,代码来源:LineSymbolizer.cs

示例4: OnRenderInternal

 /// <summary>
 /// Function that actually renders the linestring
 /// </summary>
 /// <param name="map"></param>
 /// <param name="lineString"></param>
 /// <param name="graphics"></param>
 protected override void OnRenderInternal(Map map, ILineString lineString, IGraphics graphics)
 {
     var gp = new GraphicsPath();
     gp.AddLines(/*LimitValues(*/lineString.TransformToImage(map)/*)*/);
     if (ImmediateMode)
     {
         var tmp = new List<GraphicsPath>(new[] {gp});
         Symbolize(graphics, map, tmp);
     }
     else
         _graphicsPaths.Add(gp);
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:18,代码来源:CachedLineSymbolizer.cs

示例5: LineStringToPath

        //private static void WarpedLabel(MultiLineString line, ref BaseLabel baseLabel, Map map)
        //{
        //    var path = MultiLineStringToPath(line, map, true);

        //    var pathLabel = new PathLabel(baseLabel.Text, path, 0f, baseLabel.Priority, new LabelBox(path.GetBounds()), baseLabel.Style);
        //    baseLabel = pathLabel;
        //}

        //private static void WarpedLabel(LineString line, ref BaseLabel baseLabel, Map map)
        //{
            
        //    var path = LineStringToPath(line, map, false);

        //    var pathLabel = new PathLabel(baseLabel.Text, path, 0f, baseLabel.Priority, new LabelBox(path.GetBounds()), baseLabel.Style);
        //    baseLabel = pathLabel;
        //}


        /// <summary>
        /// Function to transform a linestring to a graphics path for further processing
        /// </summary>
        /// <param name="lineString">The Linestring</param>
        /// <param name="map">The map</param>
        /// <!--<param name="useClipping">A value indicating whether clipping should be applied or not</param>-->
        /// <returns>A GraphicsPath</returns>
        public static GraphicsPath LineStringToPath(ILineString lineString, Map map/*, bool useClipping*/)
        {
            var gp = new GraphicsPath(FillMode.Alternate);
            //if (!useClipping)
                gp.AddLines(lineString.TransformToImage(map));
            //else
            //{
            //    var bb = map.Envelope;
            //    var cohenSutherlandLineClipping = new CohenSutherlandLineClipping(bb.Left, bb.Bottom, bb.Right, bb.Top);
            //    var clippedLineStrings = cohenSutherlandLineClipping.ClipLineString(lineString);
            //    foreach (var clippedLineString in clippedLineStrings.LineStrings)
            //    {
            //        var s = clippedLineString.StartPoint;
            //        var e = clippedLineString.EndPoint;
                    
            //        var dx = e.X - s.X;
            //        //var dy = e.Y - s.Y;

            //        LineString revcls = null;
            //        if (dx < 0)
            //            revcls = ReverseLineString(clippedLineString);
                    
            //        gp.StartFigure();
            //        gp.AddLines(revcls == null ? clippedLineString.TransformToImage(map) : revcls.TransformToImage(map));
            //    }
            //}
            return gp;
        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:53,代码来源:LabelLayer.cs


注:本文中的ILineString.TransformToImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。