阅读:1502回复:1
如何在arcEngine中标注字段属性数据
利用VB.net和arcEngine中开发地图,在PageLayout中如何标准字段属性.比如我想在地图中通过选择标注"姓名"或年龄.
|
|
1楼#
发布于:2005-11-28 10:45
<P>我在VC里面调试通过的代码。</P>
<P>IGeoFeatureLayerPtr pGeoLyr;<BR> IAnnotateLayerPropertiesCollectionPtr pLabCol;<BR> IAnnotateLayerPropertiesPtr pLab;<BR> ILabelEngineLayerPropertiesPtr pLabEng;<BR> <BR> ILayerPtr ipLayer = m_MapControl.GetLayer(0);<BR> IFeatureLayerPtr ipFLayer = ipLayer;<BR> pGeoLyr = ipFLayer;<BR> <BR> pGeoLyr->get_AnnotationProperties(;pLabCol);<BR> pLabEng.CreateInstance(CLSID_LabelEngineLayerProperties);<BR> pLabEng->put_Expression(CComBSTR("[单位]"));<BR> pLabEng->putref_Symbol(GetTextSymbol(12)); <BR> pLabEng->put_IsExpressionSimple(VARIANT_TRUE);<BR> pLab = pLabEng;<BR> pLabCol->Clear();<BR> pLabCol->Add(pLab); </P> <P> pGeoLyr->put_DisplayAnnotation(VARIANT_TRUE);<BR> IActiveViewPtr ipActiveView = m_MapControl.GetActiveView();<BR> ipActiveView->Refresh(); </P> |
|
|