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();
            }
        }
    }

  • 相关阅读:
    HDU 4267 A Simple Problem with Integers
    java实现滑动解锁
    java实现滑动解锁
    java实现滑动解锁
    java实现滑动解锁
    java实现排列序数
    Delphi中文件流的使用方法
    基于Delphi7 WebService 在Apache发布及Apache使用说明
    资源文件的编译
    Delphi下IOC 模式的实现(反转模式,即Callback模式)
  • 原文地址:https://www.cnblogs.com/sdustyuleyi/p/2680109.html
Copyright © 2011-2022 走看看