访问注记层的元素和访问其他类型的地物一样,都需要通过IFeatureClass接口的Search函数获得一个IFeatureCursor对象,通过这个对象来遍历FeatureClass。
处理注记的代码为:
if (pFeature.FeatureType == esriFeatureType.esriFTAnnotation)
{
IAnnotationFeature pAnnoFeature = pFeature as IAnnotationFeature;
ITextElement pTextElement = pAnnoFeature.Annotation as ITextElement;
string a = pTextElement.Text;
double b = pTextElement.Symbol.Size;
double c = pTextElement.Symbol.Angle;
IElement pElement = pAnnoFeature.Annotation as IElement;
esriGeometryType geoType = pElement.Geometry.GeometryType;
IPoint pPoint = pElement.Geometry as IPoint;
double x = 0, y = 0;
pPoint.QueryCoords(out x, out y);
int cc = 0;
return;
}
来自:http://blog.sina.com.cn/s/blog_5432e0220100kzug.html