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


C# IDisplay.DrawPolyline方法代码示例

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


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

示例1: DrawGeometry

        /// <summary>
        /// Draws the input geometry using the specified colors.
        /// </summary>
        /// <param name="geometry">The input IGeometry to draw. Supported geometry types are GeometryBag, Polygon, Polyline, Point and Multipoint.</param>
        /// <param name="fillColor">An IRgbColor reference for the fill color</param>
        /// <param name="lineColor">An IRgbColor reference for the line or outline color</param>
        /// <param name="display">An IDisplay reference</param>
        /// <param name="cancelTracker">An ITrackCancel reference</param>
        private static void DrawGeometry(IGeometry geometry, IRgbColor fillColor, IRgbColor lineColor, IDisplay display, ITrackCancel cancelTracker)
        {
            bool continueDrawing = true;
            switch (geometry.GeometryType)
            {
                case esriGeometryType.esriGeometryBag:
                    {
                        IEnumGeometry enumGeometry = (IEnumGeometry)geometry;
                        IGeometry innerGeometry = enumGeometry.Next();
                        while (innerGeometry != null && continueDrawing == true)
                        {
                            DrawGeometry(innerGeometry, fillColor, lineColor, display, cancelTracker); // Recursive method call
                            innerGeometry = enumGeometry.Next();
                            if (cancelTracker != null)
                            {
                                continueDrawing = cancelTracker.Continue();
                            }
                        }
                        break;
                    }
                case esriGeometryType.esriGeometryPolygon:
                    {
                        // Set the input polygon geometry's symbol.
                        ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass();
                        fillSymbol.Color = (IColor)fillColor;
                        ILineSymbol lineSymbol = new SimpleLineSymbolClass();
                        lineSymbol.Color = lineColor;
                        fillSymbol.Outline = lineSymbol;

                        // Draw the input polygon geometry.
                        display.SetSymbol((ISymbol)fillSymbol);
                        display.DrawPolygon(geometry);
                        break;
                    }
                case esriGeometryType.esriGeometryPolyline:
                    {
                        // Set the input polyline geometry's symbol.
                        IMultiLayerLineSymbol multiLineSymbol = new MultiLayerLineSymbolClass();
                        ISimpleLineSymbol simpleLineSymbol1 = new SimpleLineSymbolClass();
                        ISimpleLineSymbol simpleLineSymbol2 = new SimpleLineSymbolClass();
                        simpleLineSymbol1.Width = 3;
                        simpleLineSymbol1.Color = fillColor;
                        simpleLineSymbol2.Width = 5;
                        simpleLineSymbol2.Color = lineColor;
                        multiLineSymbol.AddLayer((ILineSymbol)simpleLineSymbol2);
                        multiLineSymbol.AddLayer((ILineSymbol)simpleLineSymbol1);

                        // Draw the input polyline geometry.
                        display.SetSymbol((ISymbol)multiLineSymbol);
                        display.DrawPolyline(geometry);
                        break;
                    }
                case esriGeometryType.esriGeometryPoint:
                    {
                        // Set the input point geometry's symbol.
                        ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass();
                        simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
                        simpleMarkerSymbol.Size = 12;
                        simpleMarkerSymbol.Color = fillColor;
                        simpleMarkerSymbol.Outline = true;
                        simpleMarkerSymbol.OutlineColor = lineColor;

                        // Draw the input point geometry.
                        display.SetSymbol((ISymbol)simpleMarkerSymbol);
                        display.DrawPoint(geometry);
                        break;
                    }
                case esriGeometryType.esriGeometryMultipoint:
                    {
                        // Set the input multipoint geometry's symbol.
                        ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass();
                        simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
                        simpleMarkerSymbol.Size = 8;
                        simpleMarkerSymbol.Color = fillColor;
                        simpleMarkerSymbol.Outline = true;
                        simpleMarkerSymbol.OutlineColor = lineColor;

                        // Draw the input multipoint geometry.
                        display.SetSymbol((ISymbol)simpleMarkerSymbol);
                        display.DrawMultipoint(geometry);
                        break;
                    }
            }
        }
开发者ID:HabitatFramework,项目名称:HLUTool,代码行数:92,代码来源:HluArcMapExtension.cs

示例2: draw

 public override void draw(IDisplay display, IGeometry geometry)
 {
     display.DrawPolyline(geometry);
 }
开发者ID:BGCX261,项目名称:ziggis-svn-to-git,代码行数:4,代码来源:layer_helper.cs


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