Table tblTemp = Cat.GetTable("Animation");if (tblTemp != null) //Table exists close it{
Cat.CloseTable("Animation");
}
tblInfoTemp.Columns.Add(ColumnFactory.CreateFeatureGeometryColumn(mapControl1.Map.GetDisplayCoordSys()));
tblInfoTemp.Columns.Add(ColumnFactory.CreateStyleColumn());
tblInfoTemp.Columns.Add(ColumnFactory.CreateStringColumn("Name", 40));
tblInfoTemp.Columns.Add(ColumnFactory.CreateStringColumn("Dept", 15));
tblInfoTemp.Columns.Add(ColumnFactory.CreateIntColumn("Level"));
tblTemp = Cat.CreateTable(tblInfoTemp);
FeatureLayer lyr = new FeatureLayer(tblTemp);
//创建点
FeatureGeometry pt = new
MapInfo.Geometry.Point(lyr.CoordSys, new DPoint(100, 150)) as FeatureGeometry;
CompositeStyle cs = new CompositeStyle(new SimpleVectorPointStyle(37, System.Drawing.Color.Red, 40));Feature ftr = new
Feature(tblTemp.TableInfo.Columns);
ftr.Geometry = pt; //改变点的属性及样式信息ftr.Style = cs;
ftr["Name"] = "Kelly"; //注意可以运用索引的方式来访问属性
ftr["Dept"] = "Sales";
ftr["Level"] = 3;
tblTemp.InsertFeature(ftr);
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-27890-3.html
感动
教授本是代表了文化