key=fLyr.Table.InsertFeature(feature);
//添加字体图样式
//FontPointStylefStyle=newFontPointStyle();
//fStyle.Color=Color.Red;
//fStyle.Font.Name="NewComVehicle";
//fStyle.PointSize=Convert.ToInt16(24);
//fStyle.Attributes=StyleAttributes.PointAttributes.BaseAll;
//fStyle.SetApplyAll();
FontPointStylefStyle=newFontPointStyle();
fStyle.Code=66;
fStyle.PointSize=48;
fStyle.Color=System.Drawing.Color.Red;
fStyle.Font.Name="Uniwill";
fStyle.Font.FontWeight=MapInfo.Styles.FontWeight.Bold;
fStyle.Angle=900;
point=newDPoint(180,85);
geoPoint=newMapInfo.Geometry.Point(myMap.GetDisplayCoordSys(),point);
feature=newFeature(geoPoint,fStyle);
key=fLyr.Table.InsertFeature(feature);
#endregion
}
//NowRestoreState
StateManager.GetStateManagerFromSession().RestoreState();
}
}
其他部分的相关代码如下:
Code
//Atthetimeofunloadingthepage,savethestate
protectedvoidPage_UnLoad(objectsender,System.EventArgse)
{
if(StateManager.IsManualState())
{
StateManager.GetStateManagerFromSession().SaveState();
}
}
privateMapInfo.Mapping.MapGetMapObj()
{
MapInfo.Mapping.MapmyMap=MapInfo.Engine.Session.Current.MapFactory[MapControl1.MapAlias];
if(myMap==null)
{
myMap=MapInfo.Engine.Session.Current.MapFactory[0];
}
returnmyMap;
}
以上得到的界面效果如下图所示,分别有3个对应的图标与之对应。

本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-36540-4.html
他在体制内演讲
证明我们有足够的实力保卫国家的任何一寸土地
没人敢惹吧