ITextSymbol textSymbol = new TextSymbolClass(); //Create a text symbol
textSymbol.Size = 25;
ITextElement textElement = new TextElementClass(); //Create a new text element
textElement.Symbol = textSymbol; //Set the text element properties Element.Symbol = textSymbol;
textElement.Text = DateTime.Now.ToShortDateString();
IElement pElement = (IElement)textElement; //QI for Ielement
pElement.Geometry = dPoint; //Set the elements geometryQI,得到IElement接口对象,用于设置元素的Geometry
axMapControl1.ActiveView.GraphicsContainer.AddElement(pElement, 0);//Add the element to the graphics container将元素添加到MapPageLayout中
axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);//局部刷新Refresh the graphics
#endregion
textSymbol.Size = 25;
ITextElement textElement = new TextElementClass(); //Create a new text element
textElement.Symbol = textSymbol; //Set the text element properties Element.Symbol = textSymbol;
textElement.Text = DateTime.Now.ToShortDateString();
IElement pElement = (IElement)textElement; //QI for Ielement
pElement.Geometry = dPoint; //Set the elements geometryQI,得到IElement接口对象,用于设置元素的Geometry
axMapControl1.ActiveView.GraphicsContainer.AddElement(pElement, 0);//Add the element to the graphics container将元素添加到MapPageLayout中
axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);//局部刷新Refresh the graphics
#endregion