您的位置:首页 > 其它

ArcEngine添加标题

2013-04-12 10:07 211 查看
private void addTitle()
{
//ESRI.ArcGIS.Carto.IActiveView activeView;
//ESRI.ArcGIS.Carto.IGraphicsContainer graphicsContainer;
//ESRI.ArcGIS.Carto.ITextElement textElement;
//ESRI.ArcGIS.Display.ITextSymbol textSymbol;
//ESRI.ArcGIS.Display.IRgbColor rgbColor;
//ESRI.ArcGIS.Carto.IElement element;
//ESRI.ArcGIS.Geometry.IEnvelope envelope;
//activeView = axPageStation.PageLayout as ESRI.ArcGIS.Carto.IActiveView;
//envelope = new ESRI.ArcGIS.Geometry.EnvelopeClass();
//envelope.PutCoords(-14, 29, 35, 29);
//textElement = new ESRI.ArcGIS.Carto.TextElementClass();
//element = textElement as ESRI.ArcGIS.Carto.IElement;
//element.Geometry = envelope;
//textElement.Text = DateTime.Now.ToString("yyyy年M月d日") + "北京市**区站点降雨图";
//textSymbol = new ESRI.ArcGIS.Display.TextSymbolClass();
//rgbColor = new ESRI.ArcGIS.Display.RgbColorClass();
//rgbColor.Red = 0;
//rgbColor.Green = 0;
//rgbColor.Blue = 0;
//textSymbol.Color = rgbColor as ESRI.ArcGIS.Display.IColor;
//IFontDisp pFont = new StdFont()
//{
//    Name = "宋体",
//    Bold = true,
//    //Size=30
//} as IFontDisp;
//textSymbol.Font = pFont;
//textSymbol.Size = 30;
//textElement.Symbol = textSymbol;
//graphicsContainer = activeView as ESRI.ArcGIS.Carto.IGraphicsContainer;
//graphicsContainer.AddElement(element, 0);
//axPageStation.Refresh();

//IActiveView activeView = axPageStation.PageLayout as IActiveView;
//IGraphicsContainer graphicsContainer = activeView as IGraphicsContainer;
IGraphicsContainer graphicsContainer = axPageStation.PageLayout as IGraphicsContainer;
IEnvelope envelope = new EnvelopeClass();
envelope.PutCoords(-14, 29, 35, 29);
IRgbColor pColor = new RgbColorClass()
{
Red = 0,
Blue = 0,
Green = 0
};
IFontDisp pFont = new StdFont()
{
Name = "宋体",
Bold = true
} as IFontDisp;
ITextSymbol pTextSymbol = new TextSymbolClass()
{
Color = pColor,
Font = pFont,
Size = 30
};
ITextElement pTextElement = new TextElementClass()
{
Symbol = pTextSymbol,
ScaleText = true,
Text = DateTime.Now.ToString("yyyy年M月d日") + "北京市**区站点降雨图"
};
IElement element = pTextElement as ESRI.ArcGIS.Carto.IElement;
element.Geometry = envelope;
graphicsContainer.AddElement(element, 0);
axPageStation.Refresh();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: