欢迎您来到GIS动力

加入收藏 免费注册 用户登陆 帮助中心
首页 新闻动态 技术专栏 银杏树下 学习考研 软件下载 求职招聘 许愿瓶 节日祝福 用户中心 精彩推荐 资源搜索 地图
专栏导航: AO开发 | SO开发 | ArcGIS桌面 | 超图桌面 | 开发语言 | 数据库 | WebGIS | 银杏文学 | 研究生考题 | FreeMap FreeTalk
   您现在位于: 首页技术专栏ArcGIS应用与开发AO开发 → 正文
AE创建Annotation
08-06-13 08:38:08 作者:本站 出处:『GIS动力』原创
''' <summary>

''' 创建Annotation类型的featureclass

''' </summary>

''' <param name="pWorkspace">annotation的工作空间</param>

''' <param name="pTextSymbol">annotation的symbol</param>

''' <param name="pRefeScale">annotation的比例</param>

''' <param name="pAnnoFeatName">annotation的名称</param>

''' <returns>创建的Annotation Featureclass</returns>

''' <remarks></remarks>

Private Function CreateAnnoFeatCls(ByVal pWorkspace As IFeatureWorkspace, ByVal pTextSymbol As ITextSymbol, ByVal pRefeScale As Double, ByVal pAnnoFeatName As String, Optional ByVal pSymbolID As Integer = 0) As IFeatureClass
Dim pField As IField
Dim pFields As IFields
Dim pSource As IClone
Dim pObjectClassDesc As IObjectClassDescription
Dim pFeatClassDesc As IFeatureClassDescription
''创建Annotation的Fields

pObjectClassDesc
= New AnnotationFeatureClassDescription
pFeatClassDesc
= pObjectClassDesc
pSource
= pObjectClassDesc.RequiredFields
pFields
= pSource.Clone
''创建Annotation的Geometry defintion

pField
= pFields.Field(pFields.FindField(pFeatClassDesc.ShapeFieldName))
''创建Reference scale

Dim pGraphicsLayerScale As IGraphicsLayerScale
pGraphicsLayerScale
= New GraphicsLayerScale
pGraphicsLayerScale.ReferenceScale
= pRefeScale
pGraphicsLayerScale.Units
= esriUnits.esriMeters
''创建Symbolcollection

Dim pSymbolColl As ISymbolCollection2
Dim pSymbolIdent As ISymbolIdentifier2 = New SymbolIdentifier
pSymbolColl
= New SymbolCollection
pSymbolColl.AddSymbol(pTextSymbol,
"Default", pSymbolIdent)
If pSymbolID = 1 Then pSymbolColl.AddSymbol(pTextSymbol, "Default 1", pSymbolIdent)
''创建Label的相关属性

Dim pOverposterProperties As IOverposterProperties
Dim pAnnoPropsColl As IAnnotateLayerPropertiesCollection
Dim pLabelEngineLP As ILabelEngineLayerProperties
Dim pAnnotateLayerProps As IAnnotateLayerProperties
pOverposterProperties
= New BasicOverposterProperties
pAnnoPropsColl
= New AnnotateLayerPropertiesCollection
pLabelEngineLP
= New LabelEngineLayerProperties
pAnnotateLayerProps
= pLabelEngineLP
pAnnotateLayerProps.Class
= "Default"

    pLabelEngineLP.Symbol = pTextSymbol
pLabelEngineLP.SymbolID
= pSymbolIdent.ID
pAnnoPropsColl.Add(pLabelEngineLP)
''创建Annotation layer

Dim pAnnoLayerFactory As IAnnotationLayerFactory
Dim pAnnoLayer As IAnnotationLayer
pAnnoLayerFactory
= New FDOGraphicsLayerFactory
pAnnoLayer
= pAnnoLayerFactory.CreateAnnotationLayer(pWorkspace, Nothing, pAnnoFeatName, pField.GeometryDef, Nothing, pAnnoPropsColl, pGraphicsLayerScale, pSymbolColl, False, False, False, True, pOverposterProperties, "")
Return CType(pAnnoLayer, IFeatureLayer).FeatureClass
End Function

(本文已被浏览 次)
发布人:admin
推荐给好友:发送给好友
上篇新闻:
下篇新闻:
相关评论
发表我的评论
  • 尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法;
  • 本站有权保留或删除您发表的任何评论内容;
  •   相关文章  
    把Annotation转换为Polygon Features
    向Annotation图层添加feature 
    AE指定字段转成注记
    CRS-0184: Cannot communicate with the CRS daemon
    标注与注记(Label与Annotation)关系与区别
    Annotation小感

    关于我们友情链接 ┋ 与我在线 ┋ 管理 ┋ TOP
     
    网站当前版本:GisPower CMS V3.0
    『GIS 动力』- http://www.gispower.org/
    联系我们:webmaster#gispower.org
    Copyright (c) 2003-2007 GisPOwer.Org. All Rights Reserved.
     

                   滇ICP备05006901号