ldj
ldj
路人甲
路人甲
  • 注册日期2003-10-19
  • 发帖数161
  • QQ
  • 铜币737枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1556回复:2

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

楼主#
更多 发布于:2006-11-07 15:13
<P>以下是地图标注的代码,哪位知道这些标注如何随着地图的变化而变化</P>
<P>'在pFeatureLayer上以strField字段作标注专题图<BR>Public Function LabelRender(pFeatureLayer As IFeatureLayer, strField As String) ', dMax As Double, dMin As Double)<BR>   Dim pGeoFeatureLayer As IGeoFeatureLayer<BR>    Dim plinelablePosition As ILineLabelPosition<BR>    Dim pLableEnginep As ILabelEngineLayerProperties<BR>    Dim pAnnotateLayer As IAnnotateLayerProperties<BR>    Dim pAnnoLayerPropsColl As IAnnotateLayerPropertiesCollection<BR>    <BR>    Set pGeoFeatureLayer = pFeatureLayer<BR>    Set plinelablePosition = New LineLabelPosition<BR>    pGeoFeatureLayer.AnnotationProperties.Clear<BR>    plinelablePosition.Above = False<BR>    plinelablePosition.AtEnd = False<BR>    plinelablePosition.Below = False<BR>    plinelablePosition.Horizontal = False<BR>    plinelablePosition.InLine = True<BR>    plinelablePosition.OnTop = True<BR>    plinelablePosition.Parallel = True<BR>    plinelablePosition.ProduceCurvedLabels = True<BR>    Set pLableEnginep = New LabelEngineLayerProperties<BR>    pLableEnginep.IsExpressionSimple = True<BR>    pLableEnginep.Expression = "[" ; strField ; "]"<BR>    pLableEnginep.BasicOverposterLayerProperties.LineLabelPosition = plinelablePosition<BR>    Set pAnnotateLayer = pLableEnginep<BR>     With pAnnotateLayer<BR>     .DisplayAnnotation = True<BR>    End With<BR>   pGeoFeatureLayer.AnnotationProperties.Add pAnnotateLayer<BR>'   Set pAnnotateLayer = pGeoFeatureLayer.AnnotationProperties.QueryItem(0)<BR>'   pAnnotateLayer.AnnotationMaximumScale = dMax<BR>'   pAnnotateLayer.AnnotationMinimumScale = dMin<BR>'   Set pAnnoLayerPropsColl = pGeoFeatureLayer.AnnotationProperties<BR>'   pAnnoLayerPropsColl.QueryItem 0, pAnnotateLayer, Nothing, Nothing<BR>'   pAnnotateLayer.AnnotationMaximumScale = 1# / 496712<BR>'   pAnnotateLayer.AnnotationMinimumScale = 1# / 1286358<BR>   <BR>   pGeoFeatureLayer.DisplayAnnotation = True<BR>   <BR>End Function</P>
喜欢0 评分0
hsghxm
路人甲
路人甲
  • 注册日期2004-10-27
  • 发帖数517
  • QQ4604052
  • 铜币1枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2006-11-07 18:04
<P>一般情况是不应该变的,如果想变的话是可以的,自己把要标注的信息画上去了</P>


<P>public void  Draw(ref IActiveView pActiveView)<BR>  {   <BR>   if(m_Array.Count<1)return;<BR>   else<BR>   {<BR>    ClsFunction m_Function = new ClsFunction(pActiveView);//调用公共函数<BR>    double pTempDis=m_Function.ConvetToMapDistance(10,pActiveView.ScreenDisplay);<BR>    IEnvelope pEnve = pActiveView.Extent; <BR>    for(int i=0;i<m_Array.Count;i++)<BR>    {    <BR>     IGeometry pGeom ;<BR>     IClone pClone;    <BR>     LabelInfo pLabelInfo = m_Array.GetByIndex(i) as  LabelInfo;<BR>     IPoint pPoit = new PointClass();          <BR>     pGeom =pLabelInfo.m_Geometry;<BR>     pClone=pGeom as IClone ;<BR>     pPoit =pClone.Clone () as IPoint;    <BR>     if(ClsGlobal.InEnve(pPoit.X,pPoit.Y,ref pEnve))//判断是否当前屏幕可视范围内<BR>     {<BR>      string strValue = pLabelInfo.Label;<BR>      IPoint mPoit = new PointClass(); <BR>      mPoit.X = pPoit.X+ pTempDis;<BR>      mPoit.Y =pPoit.Y+ pTempDis; <BR>      IFormattedTextSymbol  pTextSymbol = new TextSymbolClass();<BR>      System.Drawing.Font drawFont = new System.Drawing.Font(nFont, int.Parse(pFont), FontStyle.Regular);<BR>      pTextSymbol.Font =(stdole.IFontDisp) OLE.GetIFontDispFromFont(drawFont);//字体<BR>      pTextSymbol.Color=m_Function.CreateColor(panel1.BackColor.R,panel1.BackColor.G,panel1.BackColor.B);<BR>      pActiveView.ScreenDisplay.SetSymbol(pTextSymbol as ISymbol);<BR>      pActiveView.ScreenDisplay.DrawText(mPoit,strValue);<BR>     }<BR>     <BR>    }    <BR>   }<BR>  }</P>
MSN:hsghxm@163.com QQ:4604052 (很少用,最好别加) Email:hsghxm@163.com 我的BOLG:http://www.gisempire.com/blog/user1/864/index.htm
举报 回复(0) 喜欢(0)     评分
ldj
ldj
路人甲
路人甲
  • 注册日期2003-10-19
  • 发帖数161
  • QQ
  • 铜币737枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2006-11-08 09:17
二楼,你好,谢谢你的回答,能不能把全部的思路讲一下
举报 回复(0) 喜欢(0)     评分
游客

返回顶部