zoukankan      html  css  js  c++  java
  • 添加线标注ILineElement

     1 private void AddLineElement(IPolyline polyline)
     2         {
     3             try
     4             {
     5                 IPolyline pPolyline = polyline; 
     6                 IRgbColor pLineRgbColor = null;
     7                 ISimpleLineSymbol pSimpleLineSymbol = null;
     8                 ILineElement pFillShapeElement = null;
     9                 IElement pElement;
    10                 if (pPolyline != null)
    11                 {
    12                     pLineRgbColor = new RgbColorClass();
    13                     pLineRgbColor.Red = 255;
    14 
    15                     pSimpleLineSymbol = new SimpleLineSymbolClass();
    16                     pSimpleLineSymbol.Color = pLineRgbColor;
    17                     double with = 72 / this.axMapControl1.MapScale;
    18                     if (with >= 0.002)
    19                         with = 0.002;
    20                     pSimpleLineSymbol.Width = with;
    21 
    22 
    23                     pFillShapeElement = new LineElementClass();
    24                     pFillShapeElement.Symbol = pSimpleLineSymbol;
    25                     pElement = pFillShapeElement as IElement;
    26                     pPolyline.SpatialReference = this.axMapControl1.SpatialReference;
    27                     pElement.Geometry = pPolyline as IGeometry;
    28 
    29                     this.axMapControl1.ActiveView.GraphicsContainer.AddElement(pElement, 0);
    30                     this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, pElement, this.axMapControl1.ActiveView.Extent);
    31                    
    32                 }
    33                             }
    34             catch (Exception ee)
    35             {
    36                 System.Windows.Forms.MessageBox.Show(ee.Message, "添加线标注");
    37             }
    38         }
    View Code
  • 相关阅读:
    github pages 正确访问方式
    jetty 热部署
    mysql 距离函数
    通过微信公众号ID生成公众号的二维码
    SQL Server 数据库备份失败解决方法
    js 替换部分内容为星号
    mysql 允许远程登录
    nginx 跨域配置
    两台阿里云服务器之间数据迁移
    新装修入住常识有什么
  • 原文地址:https://www.cnblogs.com/fatherZyl/p/3323719.html
Copyright © 2011-2022 走看看