自制卷帘工具

Posted on 2019-11-23 20:38  云起  阅读(4)  评论(0编辑  收藏  举报  来源

先上代码:

        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 =

Copyright © 2024 云起
Powered by .NET 9.0 on Kubernetes