首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

AE10.0命名空间的摘引symbology和utility

2012-12-15 
AE10.0命名空间的引用symbology和utility本人新手,最近在学《ArcGIS Engine组件式开发及应用》时,第一章的C#

AE10.0命名空间的引用symbology和utility
本人新手,最近在学《ArcGIS Engine组件式开发及应用》时,第一章的C#示例代码如下:
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 System.Runtime.InteropServices;
using ESRI.ArcGIS.ADF.BaseClasses;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Output;
//using Symbology;
using ESRI.ArcGIS.DataSourcesFile;
//using ESRI.ArcGIS.Utility;



namespace _1._5._3
{
    public partial class Form1 : Form
    {
        IMap pMap;
        IActiveView pActiveView;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //使窗体显示最大化,并设置伙伴控件关系
            this.WindowState = FormWindowState.Maximized;
            axTOCControl1.SetBuddyControl(axMapControl1);
            axToolbarControl1.SetBuddyControl(axMapControl1);   
        }

        private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
        {
            pMap = axMapControl1.Map;
            pActiveView = pMap as IActiveView;
            IEnvelope pEnv;
            pEnv = axMapControl1.TrackRectangle();
            pActiveView.Extent = pEnv;
            pActiveView.Refresh();
        }

        private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //利用文件对话框的方式选择加载地图
            OpenFileDialog OpenFdlg = new OpenFileDialog();
            OpenFdlg.Title = "选择需要加载的地理数据文件";
            OpenFdlg.Filter = "Shape格式文件(*.shp)|*.shp";
            OpenFdlg.ShowDialog();
            string strFileName = OpenFdlg.FileName;


            if (strFileName == string.Empty)    //用户没有进行文件选择,则返回
                return;
            //用户选择了shape格式文件
            string pathName = System.IO.Path.GetDirectoryName(strFileName);
            string fileName = System.IO.Path.GetFileNameWithoutExtension(strFileName);
            //往axMapControl1中加载地图
            axMapControl1.AddShapeFile(pathName, fileName);
            //在鹰眼中加载地图
            axMapControl2.ClearLayers();
            axMapControl2.AddShapeFile(pathName, fileName);
            axMapControl2.Extent = axMapControl2.FullExtent;  //显示全图作为鸟瞰图
        }
    }
}
命名空间引用中的symbology和utility总是出问题,引用中找不到这两个引用,但是注释掉程序也能正常运行,请问怎么回事啊?
[解决办法]
你直接浏览到arcgis的文件加下,找到相应的.dll 文件
[解决办法]
我也看了这本书,这书上好多错的,实在受不了了,你上面的问题我也遇到了,其实 Symbology 是写书人在后面自己编的类!他是用后面做好的程序来说前面的内容!后面还有好多错误!

热点排行