现在的位置: 首页 > 综合 > 正文

engine下标注如何随着地图变化而变大,变小

2013年10月04日 ⁄ 综合 ⁄ 共 1274字 ⁄ 字号 评论关闭

一般情况是不应该变的,如果想变的话是可以的,自己把要标注的信息画上去了

public void  Draw(ref IActiveView pActiveView)
  {  
   if(m_Array.Count<1)return;
   else
   {
    ClsFunction m_Function = new ClsFunction(pActiveView);//调用公共函数
    double pTempDis=m_Function.ConvetToMapDistance(10,pActiveView.ScreenDisplay);
    IEnvelope pEnve = pActiveView.Extent;
    for(int i=0;i<m_Array.Count;i++)
    {    
     IGeometry pGeom ;
     IClone pClone;    
     LabelInfo pLabelInfo = m_Array.GetByIndex(i) as  LabelInfo;
     IPoint pPoit = new PointClass();          
     pGeom =pLabelInfo.m_Geometry;
     pClone=pGeom as IClone ;
     pPoit =pClone.Clone () as IPoint;    
     if(ClsGlobal.InEnve(pPoit.X,pPoit.Y,ref pEnve))//判断是否当前屏幕可视范围内
     {
      string strValue = pLabelInfo.Label;
      IPoint mPoit = new PointClass();
      mPoit.X = pPoit.X+ pTempDis;
      mPoit.Y =pPoit.Y+ pTempDis;
      IFormattedTextSymbol  pTextSymbol = new TextSymbolClass();
      System.Drawing.Font drawFont = new System.Drawing.Font(nFont, int.Parse(pFont), FontStyle.Regular);
      pTextSymbol.Font =(stdole.IFontDisp) OLE.GetIFontDispFromFont(drawFont);//字体
      pTextSymbol.Color=m_Function.CreateColor(panel1.BackColor.R,panel1.BackColor.G,panel1.BackColor.B);
      pActiveView.ScreenDisplay.SetSymbol(pTextSymbol as ISymbol);
      pActiveView.ScreenDisplay.DrawText(mPoit,strValue);
     }
    
    }    
   }
  }

 

抱歉!评论已关闭.