lzxlzxlzx
路人甲
路人甲
  • 注册日期2004-12-10
  • 发帖数3
  • QQ
  • 铜币119枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1806回复:4

注记如何按角度显示?

楼主#
更多 发布于:2005-07-03 10:23
我的注记有文字高度和文字角度字段,请问如何让注记按文字高度和文字角度字段中的值显示。(arcobjects)
喜欢0 评分0
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
1楼#
发布于:2005-07-04 11:11
<P>针对图层标注,下面贴出一个函数,供参考接口用,具体可以查查帮助</P>
<P>Public Function f_Label_MakeLabels(pGeoLayer As IGeoFeatureLayer, pLabelField As String, BOLP As IBasicOverposterLayerProperties, Optional pLabelStyle As ILabelStyle = Nothing)<BR>On Error GoTo ErrHld<BR>    If pLabelStyle Is Nothing Then<BR>        <BR>        BOLP.BufferRatio = 0<BR>        BOLP.FeatureWeight = 0<BR>        BOLP.LabelWeight = 3<BR>        BOLP.GenerateUnplacedLabels = False<BR>    <BR>        Dim LLPP As ILineLabelPlacementPriorities<BR>        Set LLPP = New LineLabelPlacementPriorities<BR>    <BR>        With LLPP<BR>            .AboveAfter = 3<BR>            .AboveAlong = 1<BR>            .AboveBefore = 3<BR>            .AboveEnd = 3<BR>            .AboveStart = 3<BR>            .BelowAfter = 3<BR>            .BelowAlong = 3<BR>            .BelowBefore = 3<BR>            .BelowEnd = 3<BR>            .BelowStart = 3<BR>            .CenterAfter = 3<BR>            .CenterAlong = 3<BR>            .CenterBefore = 3<BR>            .CenterEnd = 3<BR>            .CenterStart = 3<BR>        End With<BR>        <BR>        Dim LLP As ILineLabelPosition<BR>        Set LLP = New LineLabelPosition<BR>        LLP.ProduceCurvedLabels = False<BR>        With LLP<BR>            .Above = True<BR>            .AtEnd = False<BR>            .AtStart = False<BR>            .Below = False<BR>            .InLine = False<BR>            .Left = False<BR>            .OnTop = False<BR>            .Right = False<BR>            '** These Are Exclusive<BR>            .Parallel = True<BR>            .Perpendicular = False<BR>            .Horizontal = False<BR>        End With<BR>        <BR>        <BR>        Dim PPP As IPointPlacementPriorities<BR>        Set PPP = New PointPlacementPriorities<BR>        With PPP<BR>            .AboveCenter = 2<BR>            .AboveLeft = 3<BR>            .AboveRight = 1<BR>            .BelowCenter = 3<BR>            .BelowLeft = 3<BR>            .BelowRight = 3<BR>            .CenterLeft = 3<BR>            .CenterRight = 2<BR>        End With<BR>        <BR>        BOLP.PointPlacementOnTop = True<BR>        BOLP.LineLabelPlacementPriorities = LLPP<BR>        BOLP.LineLabelPosition = LLP<BR>        BOLP.PointPlacementPriorities = PPP<BR>        <BR>        '添加文字注记<BR>        Dim pAnnoLayerPropsColl As IAnnotateLayerPropertiesCollection<BR>        Dim aLELayerProps As ILabelEngineLayerProperties<BR>        <BR>        Dim pAnnotateLayerProperties As IAnnotateLayerProperties<BR>          <BR>        Set pAnnoLayerPropsColl = pGeoLayer.AnnotationProperties<BR>        pAnnoLayerPropsColl.QueryItem 0, aLELayerProps<BR>        Set pAnnotateLayerProperties = aLELayerProps<BR>        pAnnotateLayerProperties.AnnotationMaximumScale = m_ScaleMax<BR>        pAnnotateLayerProperties.AnnotationMinimumScale = m_ScaleMin</P>
<P>        With aLELayerProps<BR>            .Expression = pLabelField<BR>            .IsExpressionSimple = m_bIsExpressionSimple</P>
<P>            Dim i_AnnoVBScriptEngine As IAnnotationExpressionEngine<BR>            Set i_AnnoVBScriptEngine = New AnnotationVBScriptEngine</P>
<P>            Set .ExpressionParser = i_AnnoVBScriptEngine<BR>            Set .BasicOverposterLayerProperties = BOLP<BR>            <BR>            If Not m_Symbol Is Nothing Then<BR>                Set .Symbol = m_Symbol<BR>            End If<BR>        End With<BR>    End If</P>
<P>    pGeoLayer.DisplayAnnotation = True<BR>    Exit Function<BR>ErrHld:<BR>    MsgBox Err.Description ; " On f_Label_MakeLabels"<BR>End Function</P>
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
pqy_20一风
路人甲
路人甲
  • 注册日期2004-08-05
  • 发帖数52
  • QQ
  • 铜币418枚
  • 威望0点
  • 贡献值0点
  • 银元0个
2楼#
发布于:2006-03-25 10:13
<DIV class=quote><B>以下是引用<I>lzxlzxlzx</I>在2005-7-3 10:23:17的发言:</B><BR>我的注记有文字角度字段,请问如何让注记按文字角度字段中的值显示。(arcobjects)</DIV>
<P>读了例子,对于指定角度的注记文字旋转还是不清楚,能说的详细些吗</P>
举报 回复(0) 喜欢(0)     评分
pqy_20一风
路人甲
路人甲
  • 注册日期2004-08-05
  • 发帖数52
  • QQ
  • 铜币418枚
  • 威望0点
  • 贡献值0点
  • 银元0个
3楼#
发布于:2006-03-26 16:15
顶一下
举报 回复(0) 喜欢(0)     评分
pqy_20一风
路人甲
路人甲
  • 注册日期2004-08-05
  • 发帖数52
  • QQ
  • 铜币418枚
  • 威望0点
  • 贡献值0点
  • 银元0个
4楼#
发布于:2006-03-26 16:16
<P>大侠帮忙啊</P>
[此贴子已经被作者于2006-3-26 16:19:07编辑过]
举报 回复(0) 喜欢(0)     评分
游客

返回顶部