zoukankan      html  css  js  c++  java
  • 修改图层的symbol(AE+C#)

    &a

    取出一个图层的symbol 在其基础上对其进行修改

    Code
            private void button1_Click(object sender, EventArgs e)
            {
      mp;nbsp;          
    //设定要改变symbol的图层
                ILayer pLayer=m_mapControl.get_Layer(0);
                IGeoFeatureLayer pGeoFeatLayer 
    = pLayer as IGeoFeatureLayer;

                
    //得到此图层的symbol
                ISimpleMarkerSymbol pMarkerSymbol=new SimpleMarkerSymbolClass();
                pMarkerSymbol
    =GetFeatureLayerSymbol(pLayer) as ISimpleMarkerSymbol;

                
    //对symbol进行改变操作
                pMarkerSymbol.Size=20;    

                
    //把改变后的symbol赋给此图层
                ISimpleRenderer pRenderer=new SimpleRendererClass();
                pRenderer.Symbol
    =pMarkerSymbol as ISymbol;
                pGeoFeatLayer.Renderer 
    = pRenderer as IFeatureRenderer;

              
            }

            
    /// <summary> 得到指定图层的symbol</summary>
            
    /// <param name="layer"></param>
            
    /// <returns></returns>
            public ISymbol GetFeatureLayerSymbol(ILayer layer)
            {
                ISymbol pSymbol 
    = null;

                IGeoFeatureLayer pGeoFeatLayer 
    = (IGeoFeatureLayer)layer;
                IFeatureClass pFeatClass 
    = pGeoFeatLayer.FeatureClass;
                IFeatureCursor pFeatCursor 
    = pFeatClass.Search(nulltrue);
                IFeature pFeature 
    = pFeatCursor.NextFeature();

                
    if (pFeature == null)
                {
                    pFeature 
    = pFeatCursor.NextFeature();
                }
                
    else
                {
                    IFeatureRenderer pFeatRen;
                    pFeatRen 
    = pGeoFeatLayer.Renderer;
                    pSymbol 
    = pFeatRen.get_SymbolByFeature(pFeature);
                }
                
    return pSymbol;
            }
  • 相关阅读:
    primo驱动启动顺序
    Windows硬链接 软链接 符号链接 快捷方式
    关于多标签文件管理器
    WinHTTrack Website Copier使用说明
    关于极限精简版系统(RAMOS专用)的说明(FAQ)
    RAMOS (内存操作系统)-无忧百科(不断完善中)
    华为PAY公交卡建议开卡免费!
    SSD硬盘测速较低的原因备忘
    联想T470笔记本GPT改MBR分区
    MSDE2008安装备忘
  • 原文地址:https://www.cnblogs.com/myparamita/p/1453740.html
Copyright © 2011-2022 走看看