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


C# IDisplay.DrawPoint方法代码示例

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


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

示例1: Draw

    /// <summary>
    /// Draws the layer to the specified display for the given draw phase. 
    /// </summary>
    /// <param name="drawPhase"></param>
    /// <param name="Display"></param>
    /// <param name="trackCancel"></param>
    /// <remarks>the draw method is set as an abstract method and therefore must be overridden</remarks>
		public override void Draw(esriDrawPhase drawPhase, IDisplay Display, ITrackCancel trackCancel)
		{
			if(drawPhase != esriDrawPhase.esriDPGeography) return;
			if(Display == null) return;
			if(m_table == null || m_symbolTable == null) return;

			m_display = Display;
			
			IEnvelope envelope = Display.DisplayTransformation.FittedBounds as IEnvelope;	
			
			double lat, lon;
			int iconCode;
			bool selected;
			ISymbol symbol = null;

			//loop through the rows. Draw each row that has a shape
			foreach (DataRow row in m_table.Rows)
			{
				//get the Lat/Lon of the item
				lat = Convert.ToDouble(row[3]);
				lon = Convert.ToDouble(row[4]);
				//get the icon ID
				iconCode = Convert.ToInt32(row[8]);

				//get the selection state of the item
				selected = Convert.ToBoolean(row[13]);
				
				if(lon >= envelope.XMin && lon <= envelope.XMax && lat >= envelope.YMin && lat <= envelope.YMax) 
				{	
					//search for the symbol in the symbology table
					symbol = GetSymbol(iconCode, row);
					if(null == symbol)
						continue;

          m_point.X = lon;
          m_point.Y = lat;
          m_point.SpatialReference = m_spatialRef;

					//reproject the point to the DataFrame's spatial reference
					if (null != m_mapSpatialRef && m_mapSpatialRef.FactoryCode != m_layerSRFactoryCode)
            m_point.Project(m_mapSpatialRef);

					Display.SetSymbol(symbol);
          Display.DrawPoint(m_point);

					if(selected)
					{
						Display.SetSymbol(m_selectionSymbol);
            Display.DrawPoint(m_point);
					}
				}
			}
		}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:60,代码来源:RSSWeatherLayerClass.cs

示例2: draw

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

示例3: 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

示例4: DrawLogoStandard

 private void DrawLogoStandard(IDisplay Display)
 {
   tagRECT r = Display.DisplayTransformation.get_DeviceFrame();
   Display.StartDrawing(Display.hDC, (short)esriScreenCache.esriNoScreenCache);
   if (null == m_logoSymbol)
   {
     m_logoSymbol = CreateStandardLogoSymbol();
   }
   Display.SetSymbol(m_logoSymbol);
   Display.DrawPoint(Display.DisplayTransformation.ToMapPoint(120, r.bottom - 160));
   Display.FinishDrawing();
 }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:12,代码来源:DynamicLogo.cs


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