国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
C#+AE 鷹眼

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using ESRI.ArcGIS.Carto;      
using ESRI.ArcGIS.Controls;   
using ESRI.ArcGIS.Geometry;   
using ESRI.ArcGIS.Display;    
using ESRI.ArcGIS.SystemUI;  

namespace GIS_Demo1
{
    public partial class MainFrm : Form
    {
        public IMapControl2 pMapControl;
        public IMap pMap;

        public MainFrm()
        {
            InitializeComponent();
        }

        private void MainFrm_Load(object sender, EventArgs e)
        {
            pMapControl = (IMapControl2)axMapControl1.Object;
        }

        private void Exit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void axMapControl1_OnMapReplaced(object sender, ESRI.ArcGIS.Controls.IMapControlEvents2_OnMapReplacedEvent e)
        {
            //當(dāng)主地圖中更換地圖時(shí),鷹眼中的地圖也更換
            this.axMapControl2.Map = new MapClass();
            //添加主地圖中的所有圖層到鷹眼地圖控件中
            for (int i = 1; i <= axMapControl1.LayerCount; i++)
            {
                axMapControl2.AddLayer(this.axMapControl1.get_Layer(this.axMapControl1.LayerCount - i));
            }
            //設(shè)置鷹眼顯示范圍至數(shù)據(jù)的全局范圍
            this.axMapControl2.Extent = axMapControl1.FullExtent;
            //刷新鷹眼地圖控件
            this.axMapControl2.Refresh();
        }

        private void axMapControl1_OnExtentUpdated(object sender, IMapControlEvents2_OnExtentUpdatedEvent e)
        {
            //得到新范圍
            IEnvelope pEnv = (IEnvelope)e.newEnvelope;
            IGraphicsContainer pGra = axMapControl2.Map as IGraphicsContainer;
            IActiveView pAv = pGra as IActiveView;
            //重新繪制前,清除之前繪制的圖形元素
            pGra.DeleteAllElements();
            IRectangleElement pRectangleEle = new RectangleElementClass();
            IElement pEle = pRectangleEle as IElement;
            pEle.Geometry = pEnv;
            //設(shè)置鷹眼中的紅線(xiàn)框
            IRgbColor pColor = new RgbColorClass();
            pColor.Red = 255;
            pColor.Green = 0;
            pColor.Blue = 0;
            pColor.Transparency = 255;
            //產(chǎn)生一個(gè)線(xiàn)符號(hào)對(duì)象
            ILineSymbol pOutline = new SimpleLineSymbolClass();
            pOutline.Width = 2;
            pOutline.Color = pColor;
            //設(shè)置填充對(duì)象的顏色屬性
            pColor = new RgbColorClass();
            pColor.Red = 255;
            pColor.Green = 0;
            pColor.Blue = 0;
            pColor.Transparency = 0;
            // 設(shè)置填充符號(hào)的屬性
            IFillSymbol pFillSymbol = new SimpleFillSymbolClass();
            pFillSymbol.Color = pColor;
            pFillSymbol.Outline = pOutline;
            IFillShapeElement pFillShapEle = pEle as IFillShapeElement;
            pFillShapEle.Symbol = pFillSymbol;
            pGra.AddElement((IElement)pFillShapEle, 0);
            //刷新
            pAv.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
        }

        private void axMapControl2_OnMouseMove(object sender, IMapControlEvents2_OnMouseMoveEvent e)
        {
            if (e.button != 1) return;
            IPoint pPoint = new PointClass();
            pPoint.PutCoords(e.mapX, e.mapY);
            this.axMapControl1.CenterAt(pPoint);
            this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
        }

        private void axMapControl2_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
        {
            if (this.axMapControl2.Map.LayerCount != 0)
            {
                //左鍵移動(dòng)
                if (e.button == 1)
                {
                    IPoint pPoint = new PointClass();
                    pPoint.PutCoords(e.mapX, e.mapY);
                    IEnvelope pEnvelope = this.axMapControl1.Extent;
                    pEnvelope.CenterAt(pPoint);
                    this.axMapControl1.Extent = pEnvelope;
                    this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
                }
                //右鍵畫(huà)矩形
                else if (e.button == 2)
                {
                    IEnvelope pPenvelope = this.axMapControl2.TrackRectangle();
                    this.axMapControl1.Extent = pPenvelope;
                    this.axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
                }
            }
        }

        private void PropertyQuery_Click(object sender, EventArgs e)
        {
            //使用pMapControl要先在MainFrm_Load下對(duì)pMapControl賦值
            Form PropertyQueryFrm = new PropertyQueryFrm(pMapControl);
            PropertyQueryFrm.Show();
        }

        private void AddData_Click(object sender, EventArgs e)
        {
            ICommand pCommand = new ControlsAddDataCommandClass();
            pCommand.OnCreate(this.axMapControl1.Object);
            pCommand.OnClick();
            for (int i = 1; i <= axMapControl1.LayerCount; i++)
            {
                axMapControl2.AddLayer(this.axMapControl1.get_Layer(this.axMapControl1.LayerCount - i));
            }
            this.axMapControl2.Extent = axMapControl1.FullExtent;
            this.axTOCControl1.SetBuddyControl(axMapControl1.Object );
            this.axTOCControl1.Refresh();
            this.axMapControl2.Refresh();
        }

        private  void SpatialQuery_Click(object sender, EventArgs e)
        {
            QueryPropertyFrm qpFrm = new QueryPropertyFrm(pMapControl);
            qpFrm.Show();
        }

        private   void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
        {


            if (e.button == 1 && QueryPropertyFrm.QueryPropertyTool == true)
            {
                IEnvelope pEnvelop = pMapControl.TrackRectangle();
                IMap pMap = pMapControl.Map;
                IActiveView pActiveView = (IActiveView)pMap;
                pMap.ClearSelection();
                pActiveView.Refresh();
                PropertyListFrm PropertyListFrm = new PropertyListFrm(pMapControl, pEnvelop);
                PropertyListFrm.Show();
            }
        }

        private   void CancelSpatialQuery_Click(object sender, EventArgs e)
        {
            QueryPropertyFrm.QueryPropertyTool = false;  //取消圖查屬性
            IMap pMap = pMapControl.Map ;
            IActiveView pActiveView = (IActiveView)pMap;
            pMap.ClearSelection();
            pActiveView.Refresh();
        }

        private void axToolbarControl1_OnMouseMove(object sender, IToolbarControlEvents_OnMouseMoveEvent e)
        {
            // 取得鼠標(biāo)所在工具的索引號(hào)
            int index = axToolbarControl1.HitTest(e.x, e.y, false);
            if (index != -1)
            {
                // 取得鼠標(biāo)所在工具的 ToolbarItem
                IToolbarItem toolbarItem = axToolbarControl1.GetItem(index);
                // 設(shè)置狀態(tài)欄信息
                MessageLabel.Text = toolbarItem.Command.Message;
            }
            else
            {
                MessageLabel.Text = " 就緒 ";
            }
        }

        private void axMapControl1_OnMouseMove(object sender, IMapControlEvents2_OnMouseMoveEvent e)
        {
            // 顯示當(dāng)前坐標(biāo)
            CoordinateLabel.Text = " 當(dāng)前坐標(biāo) X = " + e.mapX.ToString() + " Y = " + e.mapY.ToString() + " " + this.axMapControl1.MapUnits;
        }

        private void DataEdit_Click(object sender, EventArgs e)
        {
            DataFrm dtFrm = new DataFrm(pMapControl );
            dtFrm.Show();
        }
    }
}



本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶(hù)發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
AE開(kāi)發(fā)中、放大、縮小、漫游、全圖的實(shí)現(xiàn)
對(duì)于“委托”的解釋摘錄(二)
DataGridView同步更新到數(shù)據(jù)庫(kù)
C#實(shí)現(xiàn)TreeView節(jié)點(diǎn)上下左右自由移動(dòng)
服務(wù)器+客戶(hù)端的聊天程序 - 51CTO.COM
ASP.NET- Cookie操作詳解(寫(xiě)入、讀取、修改、刪除)
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服