reecho
路人甲
路人甲
  • 注册日期2004-07-16
  • 发帖数31
  • QQ
  • 铜币184枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:3288回复:1

[求助]标注图层的问题?

楼主#
更多 发布于:2005-09-27 12:20
<P>  用ae在c#里的程序,但是却显示不出标注,不知道是什么原因?而且当我用pCollection.QueryItem(0,pAnnoLP ,null,null )时候,编译器提示这样的错误,不知道怎么改,<BR>参数“2” : 无法从“ESRI.ArcGIS.Carto.IAnnotateLayerProperties”转换为“out ESRI.ArcGIS.Carto.IAnnotateLayerProperties”<BR> 参数“3” : 无法从“int”转换为“out ESRI.ArcGIS.Carto.IElementCollection”<BR>参数“4” : 无法从“int”转换为“out ESRI.ArcGIS.Carto.IElementCollection”<BR>请各位多多指教!多谢了!</P>
<P>IFeatureLayer pFeatureLayer = (IFeatureLayer)layer;<BR>IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)pFeatureLayer;<BR>pGeoFeatureLayer.AnnotationProperties.Clear();</P>
<P>IAnnotateLayerPropertiesCollection pCollection =pGeoFeatureLayer.AnnotationProperties;</P>
<P>IBasicOverposterLayerProperties basicOverP = new BasicOverposterLayerPropertiesClass();<BR>basicOverP.NumLabelsOption = esriBasicNumLabelsOption.esriOneLabelPerShape;</P>
<P>string filed = labelDlg.GetNewLabelField(); ILabelEngineLayerProperties pLabelEngine = new LabelEngineLayerPropertiesClass();</P>
<P>ITextSymbol pTextSymbol =pLabelEngine.Symbol; <BR>pTextSymbol.Size = labelDlg.GetNewSize();</P>
<P>IFontDisp pFont = pLabelEngine.Symbol.Font;<BR>pFont.Bold = labelDlg.GetIsBold();<BR>pFont.Italic = labelDlg.GetIsItalic();<BR>pFont.Underline = labelDlg.GetIsUnderline();<BR>pTextSymbol.Font = pFont;<BR>pLabelEngine.Expression = "[field]";<BR>pLabelEngine.BasicOverposterLayerProperties = basicOverP;<BR>pLabelEngine.Symbol = pTextSymbol;</P>
<P>IAnnotateLayerProperties pAnnoLP = (IAnnotateLayerProperties)pLabelEngine;<BR>pAnnoLP.FeatureLayer = pGeoFeatureLayer;<BR>pAnnoLP.LabelWhichFeatures = esriLabelWhichFeatures.esriAllFeatures;</P>
<P>pGeoFeatureLayer.AnnotationProperties.Add( pAnnoLP );</P>
<P>if( labelDlg.isCheckedLabelButton() )<BR>pGeoFeatureLayer.DisplayAnnotation = true;<BR>else<BR>pGeoFeatureLayer.DisplayAnnotation = false;</P>
喜欢0 评分0
dingsheng_0
路人甲
路人甲
  • 注册日期2005-03-24
  • 发帖数34
  • QQ
  • 铜币272枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2005-10-09 23:13
<P>简单标注</P>
<P>   ILabelEngineLayerProperties  pLabelEngin;</P>
<P>  IAnnotateLayerPropertiesCollection pAnnProCol;<BR>   pAnnProCol = pGeoFeatureLayer.AnnotationProperties;<BR>    IAnnotateLayerProperties  pAnnoLayerProps ; <BR>   pBasicOverposterLayerProps.NumLabelsOption   =esriBasicNumLabelsOption.esriOneLabelPerName;<BR>   for (int i = 0 ;i<= pAnnProCol.Count - 1;i++)<BR>   {   IElementCollection MMM;<BR>    pAnnProCol.QueryItem(0,out  pAnnoLayerProps   , out MMM,out MMM);<BR>     pLabelEngin = pAnnoLayerProps as ILabelEngineLayerProperties;<BR>    pLabelEngin.Expression = "["+file+"]";<BR>    pLabelEngin.BasicOverposterLayerProperties = pBasicOverposterLayerProps;<BR>   }<BR>   <BR>    pAnnoLayerProps.DisplayAnnotation =true;<BR>   IActiveView pActiveView = pMapControl.Map as IActiveView;<BR>  // pGeoFeatureLayer.DisplayAnnotation = true; <BR> pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection,null,pMapControl.ActiveView.Extent); </P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部