mappagelayout指定位置显示时间

来源:互联网 发布:网络第一辣妈高云微博 编辑:程序博客网 时间:2024/05/16 05:19
                         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