arcgis engine C#中使用label

1 动态更改label的expression

            IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)axMapControl.get_Layer(1);

            IAnnotateLayerPropertiesCollection pAnnoLayerPropsColl = pGeoFeatureLayer.AnnotationProperties;

            IElementCollection ec;
            IAnnotateLayerProperties pAnnoLayerProps;
            pAnnoLayerPropsColl.QueryItem(0, out pAnnoLayerProps, out ec, out ec);


            ILabelEngineLayerProperties pLabelEngineLayerProps = (ILabelEngineLayerProperties)pAnnoLayerProps;
            pLabelEngineLayerProps.Expression = "bar";

            axMapControl.Refresh();


2 用where语句动态更改哪些要素类需要label
            IGeoFeatureLayer pGeoFeatureLayer = (IGeoFeatureLayer)axMapControl.get_Layer(1);
            IAnnotateLayerPropertiesCollection pAnnoLayerPropsCollection = pGeoFeatureLayer.AnnotationProperties;
			
			IAnnotateLayerProperties predictPointLabelEngineLayerProps;
			
            pAnnoLayerPropsCollection.QueryItem(0, out predictPointLabelEngineLayerProps, out ec, out ec);
            predictPointLabelEngineLayerProps.WhereClause = "id > 100";


3 label中绝对值小于1的小数不显示小数点前的0.
居然需要到操作系统的控制面板中修改


猜你喜欢

转载自kabike.iteye.com/blog/2176328
今日推荐