• 大小: 5.1MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-02
  • 语言: C#
  • 标签: ArcGIS  C#  WPF  

资源简介

最近做AE和WPF的二次开发时,关于无向网了的创建,我参照了ArcGIS Engine 10开发手册这本书中的代码,为了方便大家,就把这本书的代码0分赠送了。要正常运行,最好先安装ArcGIS 的 SDK for .net 和 Runtime,如果安装了 ArcGIS 的Desktop,那么安装下SDK就可以了。需要Runtime的话请给我留言,我会进行上传

资源截图

代码片段和文件信息

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.esriSystem;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.GlobeCore;
using ESRI.ArcGIS.DataSourcesFile;

namespace EngineApplication
{
    class BarRender
    {


        public BarRender(AxMapControl pMapcontrol IFeaturelayer pFtlayer String pFieldName1 string pFieldName2)
        {



            IGeoFeaturelayer pGeoFeaturelayer = pFtlayer as IGeoFeaturelayer;

            pGeoFeaturelayer.ScaleSymbols = true;


            IFeatureClass pFeatureClass = pFtlayer.FeatureClass;

            //定义柱状图渲染组建对象
            IChartRenderer pChartRenderer = new ChartRendererClass();
            //定义渲染字段对象并给字段对象实例化为pChartRenderer
            IRendererFields pRendererFields;
            pRendererFields = (IRendererFields)pChartRenderer;
            //向渲染字段对象中添加字段--- 待补充自定义添加
            pRendererFields.AddField(pFieldName1 pFieldName1);
            pRendererFields.AddField(pFieldName2 pFieldName2);

            ITable pTable= pGeoFeaturelayer as ITable;

            int[] pFieldIndecies = new int[2];

            pFieldIndecies[0] = pTable.FindField(pFieldName1);
            pFieldIndecies[1] = pTable.FindField(pFieldName2);



            IDataStatistics pDataStat = new DataStatisticsClass();

            IFeatureCursor pFtCursor = pFtlayer.FeatureClass.Search(null false);

            pDataStat.Cursor = pFtCursor as ICursor;

            pDataStat.Field = pFieldName2;

            double pMax = pDataStat.Statistics.Maximum;

            // 定义并设置渲染时用的chart marker symbol
            IBarChartSymbol pBarChartSymbol = new BarChartSymbolClass();

            pBarChartSymbol.Width = 6;

            IChartSymbol pChartSymbol;
            pChartSymbol = pBarChartSymbol as IChartSymbol;

            IMarkerSymbol pMarkerSymbol;
            pMarkerSymbol = (IMarkerSymbol)pBarChartSymbol;



            IFillSymbol pFillSymbol;
            //设置pChartSymbol的最大值
            pChartSymbol.MaxValue = pMax;
            // 设置bars的最大高度 
            pMarkerSymbol.Size = 80;
            //下面给每一个bar设置符号

            //定义符号数组
            ISymbolArray pSymbolArray = (ISymbolArray)pBarChartSymbol;



            //添加第一个符号
            pFillSymbol = new SimpleFillSymbolClass();
            pFillSymbol.Color = GetRGBColor(193 252 179) as IColor;
            pSymbolArray.AddSymbol(pFillSymbol as ISymbol);
            //添加第二个符号
            pFillSymbol = new SimpleFillSymbolClass();
            pFillSymbol.Color = GetRGBColor(145 55 251) as IColor;
            pSymbolArray.AddSymbol(pFillSymbol as ISymbol);




            pChartRenderer.ChartSymbol = pChartSymb

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-07-09 11:13  ArcEngine开发手册(代码)\
     目录           0  2012-07-09 11:13  ArcEngine开发手册(代码)\bar\
     文件      372224  2011-04-28 22:28  ArcEngine开发手册(代码)\bar\DevComponents.DotNetBar.Design.dll
     文件     4554752  2011-04-29 00:09  ArcEngine开发手册(代码)\bar\DevComponents.DotNetBar2.dll
     目录           0  2012-07-09 11:13  ArcEngine开发手册(代码)\EngineApplication\
     文件        1295  2012-07-05 21:23  ArcEngine开发手册(代码)\EngineApplication.sln
     文件       38400  2012-07-10 10:14  ArcEngine开发手册(代码)\EngineApplication.suo
     文件         144  2012-07-02 20:48  ArcEngine开发手册(代码)\EngineApplication\app.config
     文件        4230  2011-08-11 09:39  ArcEngine开发手册(代码)\EngineApplication\BarRender.cs
     文件       34098  2011-10-18 09:38  ArcEngine开发手册(代码)\EngineApplication\biaozhu.cs
     目录           0  2012-07-09 11:13  ArcEngine开发手册(代码)\EngineApplication\bin\
     目录           0  2012-07-09 11:13  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\
     文件      372224  2011-04-28 22:28  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\DevComponents.DotNetBar.Design.dll
     文件     4554752  2011-04-29 00:09  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\DevComponents.DotNetBar2.dll
     文件      157696  2012-07-10 09:37  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\EngineApplication.exe
     文件         144  2012-07-02 20:48  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\EngineApplication.exe.config
     文件      304640  2012-07-10 09:37  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\EngineApplication.pdb
     文件       11600  2012-07-10 09:34  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\EngineApplication.vshost.exe
     文件         144  2012-07-02 20:48  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\EngineApplication.vshost.exe.config
     文件         490  2010-03-17 22:39  ArcEngine开发手册(代码)\EngineApplication\bin\Debug\EngineApplication.vshost.exe.manifest
     目录           0  2012-07-09 11:13  ArcEngine开发手册(代码)\EngineApplication\bin\x86\
     目录           0  2012-07-09 11:13  ArcEngine开发手册(代码)\EngineApplication\bin\x86\Debug\
     文件     2510848  2007-10-25 10:41  ArcEngine开发手册(代码)\EngineApplication\bin\x86\Debug\DevComponents.DotNetBar.dll
     文件      157184  2011-12-22 13:57  ArcEngine开发手册(代码)\EngineApplication\bin\x86\Debug\EngineApplication.exe
     文件      312832  2011-12-22 13:57  ArcEngine开发手册(代码)\EngineApplication\bin\x86\Debug\EngineApplication.pdb
     文件       14848  2011-12-22 13:57  ArcEngine开发手册(代码)\EngineApplication\bin\x86\Debug\EngineApplication.vshost.exe
     文件         490  2009-06-11 05:14  ArcEngine开发手册(代码)\EngineApplication\bin\x86\Debug\EngineApplication.vshost.exe.manifest
     文件        2288  2011-05-26 15:42  ArcEngine开发手册(代码)\EngineApplication\ChartRender.cs
     文件        5413  2011-05-26 15:42  ArcEngine开发手册(代码)\EngineApplication\ClassRender.cs
     文件         246  2011-12-05 15:03  ArcEngine开发手册(代码)\EngineApplication\CommandTest.bmp
     文件        4008  2011-12-05 15:03  ArcEngine开发手册(代码)\EngineApplication\CommandTest.cs
............此处省略72个文件信息

评论

共有 条评论