📄 toolcreatepolyline.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using HiMap.Carto;
using HiMap.MapControls.Tools;
using HiMap.Geometry;
namespace HiMap
{
/// <summary>
/// Tool for create polylines
/// </summary>
public class ToolCreatePolyline : ToolCreatePoint
{
public ToolCreatePolyline(Form frm, IFeatureLayer layer):base(frm,layer)
{
}
protected override void OnToolCreate(HiMap.MapControls.MapControl Map)
{
base.OnToolCreate(Map);
MePic = new PicCtrl(_frm, Map, listPoint, listPoint1, PicType.Polyline);
}
protected override void Btn3Click(object sender, EventArgs e)
{
if (listPoint.Count < 2)
{
System.Windows.Forms.MessageBox.Show("A line must have 2 nodes least, continue to draw.");
return;
}
IFeatureClass cls = (IFeatureClass)_layer.Class;
IFeature feat = null;
IPointCollection line = new PolylineClass();
for (int i = 0; i < listPoint.Count; i++)
{
feat = cls.CreateFeature();
line.AddPoint(listPoint[i]);
}
feat.Shape = line;
feat.Save();
BtnExitClick(null, null);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -