常见问题

常见问题解答:在要素图层中,不同要素的标注是否可以具有不同的颜色?

Last Published: September 13, 2023

答案

To create labels for different features have different colors in a feature class, it is necessary to create label classes. This can be done using the ESRI.ArcGIS.Carto.IAnnotateLayerProperties interface, as shown in the following example:
Pseudo Code Example:

IAnnotateLayerProperties.Class = "Class1" // Create one or more classes to represent each label color
IAnnotateLayerProperties.WhereClause = "Pop2000 > 4000" // Criteria for selecting the features to label with this color
Cast IAnnotateLayerProperties to ILabelEngineLayerProperties to set Symbol properties for the label
ILabelEngineLayerProperties.Symbol gives an ITextSymbol, which has a Color property. Use this to change the color
ILabelEngineLayerProperties.Expression = " \"State Name: \"[STATENAME] " // Actual label content

文章 ID:000016570

从 ArcGIS 专家处获得帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项

相关信息

发现关于本主题的更多内容