比如这段代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.IO.Ports;
using System.Runtime.InteropServices;
using System.Threading;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.ADF;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Analyst3D;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.GlobeCore;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitTimer();
text3DElement = new Text3DElementClass();
graphicsLayer = new GraphicsLayer3DClass();
Init3DText();
}
System.Windows.Forms.Timer Updatetimer;
IGraphicsLayer graphicsLayer;//将graphics图层定义为全局,就这么一个图层
IText3DElement text3DElement;//同上,将这个3delement也定义为全局
IGraphicsContainer3D graphicsContainer3D;//这个也是
int i = 0;
public void InitTimer()
{
Updatetimer = new System.Windows.Forms.Timer();
Updatetimer.Interval = 100;//定时器时间设为100ms,直观看到内存的增长。
Updatetimer.Tick += new EventHandler(Updatetimer_Tick);
}
public void Init3DText()
{
graphicsContainer3D = graphicsLayer as IGraphicsContainer3D;
text3DElement.FontName = "name";
text3DElement.Text = "开始";
text3DElement.AnchorPoint.X = 0;
text3DElement.AnchorPoint.Y = 0;
text3DElement.AnchorPoint.Z = 0;
text3DElement.Depth = 0.5;
text3DElement.Height = 2;
text3DElement.Height = 2;
text3DElement.BoldFont = true;
text3DElement.RotationAngle = 360;
ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbol();
IRgbColor color = new RgbColorClass();
color.Red = 255;
simpleFillSymbol.Color = color;
IFillShapeElement fillShapeElement = text3DElement as IFillShapeElement;
fillShapeElement.Symbol = simpleFillSymbol as IFillSymbol;
graphicsContainer3D.AddElement(text3DElement as IElement);
text3DElement.Update();//这里如果不添加update就显示不出来了。。。
this.axSceneControl1.Scene.AddLayer(graphicsLayer as ILayer);
this.axSceneControl1.SceneGraph.Invalidate(graphicsLayer, true, false);
this.axSceneControl1.SceneGraph.RefreshViewers();
}
int num = 0;
public void Updatetimer_Tick(object sender, EventArgs e)
{
i++;
string text = text3DElement.Text;
text = "是" + i;//还有这儿,如果我什么都不改,光update,当然是内存不变,就是说把这句删掉,不变
text3DElement.Text = text;//我就改了一下text涨这么厉害
text3DElement.Update();//内存飙升啊,就这句话
num = graphicsContainer3D.ElementCount;//这里看了下,graphicsContainer3D的确一直只有一个element存在
this.axSceneControl1.SceneGraph.Invalidate(graphicsLayer, true, false);
this.axSceneControl1.SceneGraph.RefreshViewers();
What Is ArcGISEngine? ArcGISEngine is acollection of embeddable GIS components and developer resources that can beused to extend ArcGISor build your own applications. Developers use ArcGIS ...
ArcGISEngine commands About built-in commands, menus, palettes, multi-items, and toolsets The information in this topic is useful if you're trying to programmatically use
ArcGISEngine commands About built-in commands, menus, palettes, multi-items, and toolsets The information in this topic is useful if you're trying to programmatical...
转自:http://blog.csdn.net/hellolib/article/details/39293655...Built-in Commands, Menus and Toolsets The information in this document is useful if you are trying to programmatically use a built-in Contro
转自:http://edndoc.esri.com/arcobjects/9.1/ArcGISDevHelp/TechnicalDocuments/Guids/ControlsCommands.htm Built-in Commands, Menus and Toolsets The information in this document is useful if you are ...
Running a geoprocessing tool using background geoprocessing Summary This topic explains how to programmatically execute a geoprocessing tool or geoprocessing model tool in the backgr