中国地图
GIS探索者
地图网
GIS论坛
网站首页| GIS论坛 |新闻动态 | 技术专栏 | GIS书籍 | 资源下载 | 求职招聘 | 研究生考试 | GIS博客 | GIS空间站
欢迎光临GIS空间站!   网站地图
  专栏导航:| ArcGIS | MapInfo | TopMap | 地理信息 | 遥感 | GPS | 测绘 | WebGIS | LBS | 前沿 | 数据库 | 开发 | 行业应用
  推荐栏目:| AO开发 | 业界动态 | GIS资源 | 招聘信息 | 求职简历 | 共享软件 | 电子书籍 | 研究生考题 | 电子期刊 | GIS论文
您现在的位置: GIS空间站 >> 技术专栏 >> ArcGIS >> AO开发 >> 文章正文

ArcObjects:简单的标注功能

作者:峰哥    文章来源:SINA博客    点击数:    更新时间:2007-10-23

Private Sub Anno(ByVal pGeoFeatlyr As IGeoFeatureLayer, ByVal field As String)
        Dim pAnnoProps As IAnnotateLayerPropertiesCollection
        pAnnoProps = pGeoFeatlyr.AnnotationProperties
        pAnnoProps.Clear()

        Dim pAnnoLayerProps As IAnnotateLayerProperties
        Dim pPosition As ILineLabelPosition
        Dim pPlacement As ILineLabelPlacementPriorities
        Dim pBasic As IBasicOverposterLayerProperties
        Dim pLabelEngine As ILabelEngineLayerProperties

        Dim pTextSym As ITextSymbol
        pTextSym = New TextSymbol
        Dim pFont As stdole.StdFont
        pFont = New stdole.StdFont
        pFont.Name = strFontName
        pFont.Size = iFontSize
        pTextSym.Font = pFont
        Dim pSymColor As IRgbColor
        pSymColor = New RgbColor
        pSymColor.Red = pColor.R
        pSymColor.Green = pColor.G
        pSymColor.Blue = pColor.B
        pTextSym.Color = pSymColor

        pPosition = New LineLabelPosition
        pPosition.Parallel = False
        pPosition.Perpendicular = True

        pPlacement = New LineLabelPlacementPriorities
        pBasic = New BasicOverposterLayerProperties
        pBasic.FeatureType = esriBasicOverposterFeatureType.esriOverposterPolyline
        pBasic.LineLabelPlacementPriorities = pPlacement
        pBasic.LineLabelPosition = pPosition

        pLabelEngine = New LabelEngineLayerProperties
        pLabelEngine.Symbol = pTextSym
        pLabelEngine.BasicOverposterLayerProperties = pBasic

        pLabelEngine.Expression = field
        pAnnoLayerProps = pLabelEngine

        pAnnoProps.Add(pAnnoLayerProps)
        pGeoFeatlyr.DisplayAnnotation = True

        frmMain.AxMapCtl.Refresh()
    End Sub

文章录入:3S_Studio    责任编辑:gissky  发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
■■相 关 图 书:
■■相 关 文 章:
  • ArcObjects:添加图例代码

  • 上一篇文章:

  • 下一篇文章:
  •  
    GIS博客精华
    TopMap下载
    热点文章
    热门资源
     
    关于我们 | 联系我们 | 广告服务 | 友情链接 | 申请链接 | 合作联盟 | 诚聘英才
      GIS空间站(GISSky.Net)版权所有 站长:兔八哥