先上代码:
private void Form1_Load(object sender, EventArgs e)
{
axMapControl1.LoadMxFile(@"C:\Users\zhangyang\Desktop\无标题.mxd");
axMapControl1.OnMouseMove += AxMapControl1_OnMouseMove;
axMapControl1.OnMouseUp += AxMapControl1_OnMouseUp;
IMap map = axMapControl1.Map;
IMapClipOptions clip = map as IMapClipOptions;
ISet set = new SetClass();
set.Add(map.Layer[1]);
set.Add(map.Layer[2]);
clip.ClipFilter = set;
//这种赋值方式是无效的,推测是赋值的时候是进行深度拷贝
//clip.ClipFilter = new SetClass();
//clip.ClipFilter.Add(map.Layer[1]);
//clip.ClipFilter.Add(map.Layer[2]);
}
private void AxMapControl1_OnMouseUp(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMouseUpEvent e)
{
if (e.button =