zoukankan      html  css  js  c++  java
  • 地图全屏

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using ESRI.ArcGIS.Geometry;
    using ESRI.ArcGIS.esriSystem;
    using ESRI.ArcGIS.Carto;
    using ESRI.ArcGIS.Controls;

    namespace ArcMap
    {
        public partial class FullScreen : Form
        {
            IEnvelope m_Envelope;
            public IEnvelope Envelope
            {
                set { m_Envelope = value; ; }
            }

            public FullScreen()
            {
                InitializeComponent();
            }
            public FullScreen(Form form)
            {
                
            }

            private void FullScreen_Load(object sender, EventArgs e)
            {
                 
                IObjectCopy pObjectCopy = new ObjectCopyClass();

                //FrmMain为主窗体,在主窗体类中用一个AxMapControl类型的变量pMapCon
                //来存储主窗体的axMapControl控件           
                object pCopyFromMap = FrmMain.pMapCon.ActiveView.FocusMap;
                object pCopyToMap = pObjectCopy.Copy(pCopyFromMap);
                IMap pMap = pCopyToMap as IMap;
                this.axMapControl1.Map = pMap;
                this.TopMost = true;
                this.FormBorderStyle = FormBorderStyle.None;
                int pScreenHeight = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;  //显示器高度
                int pScreenWidth = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;    //显示器宽度
                this.Top = 0;
                this.Left = 0;
                this.Width = pScreenWidth;
                this.Height = pScreenHeight;
            }

            //右键点击也退出全屏界面
            private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
            {
                if(e.button ==2)
                {
                    this.Close();
                }
            }

            //放大
            private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
            {
                //this .axMapControl1 =FrmMain.pMapCon  ;
                ESRI.ArcGIS.SystemUI.ITool tool = new ControlsMapZoomInToolClass();
                ESRI.ArcGIS.SystemUI.ICommand cmd = tool as ESRI.ArcGIS.SystemUI.ICommand;
                cmd.OnCreate(this.axMapControl1.Object);
                this.axMapControl1.CurrentTool = tool;
            }

            //缩小
            private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
            {
                ESRI.ArcGIS.SystemUI.ITool tool = new ControlsMapZoomOutToolClass();
                ESRI.ArcGIS.SystemUI.ICommand cmd = tool as ESRI.ArcGIS.SystemUI.ICommand;
                cmd.OnCreate(this.axMapControl1.Object);
                this.axMapControl1.CurrentTool = tool;
            }

            //漫游
            private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
            {
                ESRI.ArcGIS.SystemUI.ITool tool = new ControlsMapPanToolClass();
                ESRI.ArcGIS.SystemUI.ICommand cmd = tool as ESRI.ArcGIS.SystemUI.ICommand;
                cmd.OnCreate(this.axMapControl1.Object);
                this.axMapControl1.CurrentTool = tool;
            }

            //退出
            private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
            {
                this.Close();
            }
        }
    }

  • 相关阅读:
    [置顶] 2013年工作中遇到的20个问题(Bug):161-180
    Spring 3.1.1使用Mvc配置全局日期转换器,处理日期转换异常
    Java中ThreadLocal模拟和解释
    平衡
    一步一步学数据结构之1--n(二叉树遍历--非递归实现)
    RobotFramework+Selenium2环境搭建与入门实例
    UVA10168
    ubantu系统Django安装教程
    The connection to adb is down, and a severe error has occured完整解决办法
    服务端分页
  • 原文地址:https://www.cnblogs.com/sdustyuleyi/p/2680109.html
Copyright © 2011-2022 走看看