阅读:1755回复:1
vb+文字样式和文字注记问题(附代码!)
<P>请总统先生和kisssy高手帮忙:</P>
<P>不知道下面的程序什么地方出现错误了,好像调用不成功。望高手指点,不胜感激!</P> <P>Private Sub cmdFont_Click()<BR>On Error GoTo ErrHld<BR> '读取文字样式<BR> Dim pGeoLayer As IGeoFeatureLayer<BR> Set pGeoLayer = m_Layer<BR> Dim pAnnoLayerPropsColl As IAnnotateLayerPropertiesCollection<BR> Dim aLELayerProps As ILabelEngineLayerProperties<BR> Set pAnnoLayerPropsColl = pGeoLayer.AnnotationProperties<BR> pAnnoLayerPropsColl.QueryItem 0, aLELayerProps</P> <P> Dim pSelector As ISymbolSelector<BR> Set pSelector = New SymbolSelector<BR> <BR> Dim i_pTextSymbol As ITextSymbol<BR> Set i_pTextSymbol = aLELayerProps.Symbol</P> <P> Dim bOK As Boolean<BR> pSelector.AddSymbol i_pTextSymbol<BR> bOK = pSelector.SelectSymbol(m_pHookHelper.ActiveView.ScreenDisplay.hwnd)<BR> If (bOK) Then<BR> Set m_Symbol = pSelector.GetSymbolAt(0)<BR> End If<BR> Exit Sub<BR>ErrHld:<BR> MsgBox Err.Description ; " On cmdFont_Click"<BR>End Sub<BR>-------------------------------------------------------------</P> <P>Private Sub cmdStyle_Click()<BR>On Error GoTo ErrHld<BR> '读取注记样式</P> <P> Dim pGeoLayer As IGeoFeatureLayer<BR> Set pGeoLayer = m_Layer<BR> Dim pAnnoLayerPropsColl As IAnnotateLayerPropertiesCollection<BR> Dim aLELayerProps As ILabelEngineLayerProperties<BR> Set pAnnoLayerPropsColl = pGeoLayer.AnnotationProperties<BR> pAnnoLayerPropsColl.QueryItem 0, aLELayerProps</P> <P> Dim pSelector As IStyleSelector<BR> Set pSelector = New LabelStyleSelector<BR> <BR> Dim i_pTextSymbol As ITextSymbol<BR> Set i_pTextSymbol = aLELayerProps.Symbol<BR> <BR> Dim bOK As Boolean<BR> Dim pLabelStyle As ILabelStyle<BR> Set pLabelStyle = New LabelStyle<BR> Set pLabelStyle.Symbol = i_pTextSymbol<BR> Set pLabelStyle.BasicOverposterLayerProperties = aLELayerProps.BasicOverposterLayerProperties<BR>' pSelector.AddStyle pLabelStyle</P> <P> bOK = pSelector.DoModal(m_pHookHelper.ActiveView.ScreenDisplay.hwnd)<BR> If (bOK) Then<BR> Set pLabelStyle = pSelector.GetStyle(0)<BR> Set m_Symbol = pLabelStyle.Symbol<BR> End If<BR> Exit Sub<BR>ErrHld:<BR> MsgBox Err.Description ; " On cmdStyle_Click"<BR>End Sub</P> |
|
1楼#
发布于:2005-10-10 11:42
还有一个问题,有关于调用相关的功能的demo呢?
|
|