ArcEngine 图例C#源码:
private void MakeLegend(IActiveView activeView,IPageLayout pageLayout)
{
//定义图例UID对象
UID uid = new UIDClass();
uid.Value="esriCore.Legend";
//设置图例存放的坐标位置
//定义单位
pageLayout.Page.Units = esriUnits.esriCentimeters;
//得到草图容器对象
IGraphicsContainer container = pageLayout as IGraphicsContainer;
//得到当前地图的框架
IMapFrame frameElement = container.FindFrame(activeView.FocusMap) as IMapFrame;
IElement mapElement = frameElement as IElement;
IEnvelope mapEnv = mapElement.Geometry.Envelope;
IEnvelope envelope = new EnvelopeClass();
//通过当前地图框架得到相对位置
envelope.PutCoords(mapEnv.XMin, mapEnv.YMin, mapEnv.XMin + 6.5, mapEnv.YMin + 0.8);
IMapSurroundFrame frame = frameElement.CreateSurroundFrame(uid, null);
ILegend legend = frame.MapSurroun
相关文档:
protected void BindData1()
{
OracleConnection orcn = new OracleConnection("User ID=wesoftwcp; Password=wesoft; Data Source=oradb");
orcn.Open();
&nb ......
MSSQL:
declare @begin datetime
declare @End datetime
set @begin=getdate()
--执行的语句写在这里
set @End=getdate()
select datediff(millisecond,@begin,@End) as 执行的时间
--millisecond表示毫秒 如果看秒可以使用ss
C#:
很多时� ......
很多时候有一个xml字符串,没有换行,没有缩进,要生成xml文件不易阅读。下面的代码就是怎么将一个连续的xml字符串格式化输出
// a demo string
string xml = "<Root><Eles><Ele>abc</Ele><Ele>123</Ele></Eles></Root>";
System.Xml.XmlDocument doc = new System.Xml ......
今天用到这个,网上找个不错的,保存下来。
注意:这个方法是快速关机,不会保存你的任何未保存信息。
// 这个结构体将会传递给API。使用StructLayout
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct TokPriv1Luid
{
public int Count;
public ......