资源简介

自制符号选择器,实现类似ArcGIS的符号选择器功能

资源截图

代码片段和文件信息

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.Display;
using ESRI.ArcGIS.DisplayUI;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Carto;

namespace 自制符号选择器
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void axTOCControl1_OnDoubleClick(object sender ESRI.ArcGIS.Controls.ITOCControlEvents_OnDoubleClickEvent e)
        {
            /*//调用arcgis Desktop中的symbol selector
            esriTOCControlItem TocCotrol = esriTOCControlItem.esriTOCControlItemNone;
            ilayer player = null;
            IBasicMap pBasicMap = null;
            object unk = null;
            object data = null;
            if (e.button == 1)
            {
                System.Drawing.Point pos = new System.Drawing.Point(e.x e.y);
                axTOCControl1.HitTest(e.x e.y ref TocCotrol ref pBasicMap ref player ref unk ref data);
                if (TocCotrol == esriTOCControlItem.esriTOCControlItemLegendClass)
                {
                    ILegendClass pLegendClass = new LegendClassClass();
                    ILegendGroup pLegendGroup = new LegendGroupClass();
                    if (unk is ILegendGroup)
                    {
                        pLegendGroup = unk as ILegendGroup;

 
                    }
                    pLegendClass = pLegendGroup.get_Class((int)data);
                    ISymbol pSymbol = pLegendClass.Symbol;
                    ISymbolSelector pSymbolSelector = new SymbolSelectorClass();
                    bool bok = false;
                    pSymbolSelector.AddSymbol(pSymbol);
                    bok = pSymbolSelector.SelectSymbol(0);
                    if (bok)
                    {
                        pLegendClass.Symbol = pSymbolSelector.GetSymbolAt(0);
 
                    }
                    this.axMapControl1.ActiveView.Refresh();
                    this.axTOCControl1.Refresh();


                }
             
            }
            */
           
            //调用自制的符号选择器
            
            
            if (e.button == 1)
            {
                esriTOCControlItem TocCotrol = esriTOCControlItem.esriTOCControlItemNone;
                ilayer player = new FeaturelayerClass();
                IBasicMap pBasicMap = new MapClass(); ;
                object unk = new object();
                object data = new object();
                axTOCControl1.HitTest(e.x e.y ref TocCotrol ref pBasicMap ref player ref unk ref data);

                //MessageBox.Show(player.Name);
                
                if (TocCotrol == esriTOCControlItem.esriTOCControlItemLegendClass)
                {
                    //取得图例
                    ILegendClass pLegendClass = (

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      36864  2011-05-19 14:53  自制符号选择器\bin\Debug\自制符号选择器.exe

     文件      40448  2011-05-19 14:53  自制符号选择器\bin\Debug\自制符号选择器.pdb

     文件      14328  2011-05-19 14:53  自制符号选择器\bin\Debug\自制符号选择器.vshost.exe

     文件        490  2007-07-21 01:33  自制符号选择器\bin\Debug\自制符号选择器.vshost.exe.manifest

     文件       4141  2011-04-13 11:00  自制符号选择器\Form1.cs

     文件       5152  2011-04-12 14:46  自制符号选择器\Form1.Designer.cs

     文件      26440  2011-04-12 14:46  自制符号选择器\Form1.resx

     文件     119921  2011-04-11 17:47  自制符号选择器\obj\Debug\ResolveAssemblyReference.cache

     文件        937  2011-05-19 14:53  自制符号选择器\obj\Debug\自制符号选择器.csproj.FileListAbsolute.txt

     文件        912  2011-04-12 14:46  自制符号选择器\obj\Debug\自制符号选择器.csproj.GenerateResource.Cache

     文件      36864  2011-05-19 14:53  自制符号选择器\obj\Debug\自制符号选择器.exe

     文件      13919  2011-04-12 14:46  自制符号选择器\obj\Debug\自制符号选择器.Form1.resources

     文件      40448  2011-05-19 14:53  自制符号选择器\obj\Debug\自制符号选择器.pdb

     文件        180  2011-04-12 10:06  自制符号选择器\obj\Debug\自制符号选择器.Properties.Resources.resources

     文件        745  2011-04-12 13:48  自制符号选择器\obj\Debug\自制符号选择器.SymbolSelector.resources

     文件        502  2011-04-11 17:29  自制符号选择器\Program.cs

     文件       1398  2011-04-11 17:29  自制符号选择器\Properties\AssemblyInfo.cs

     文件       2892  2011-04-11 17:29  自制符号选择器\Properties\Resources.Designer.cs

     文件       5612  2011-04-11 17:29  自制符号选择器\Properties\Resources.resx

     文件       1106  2011-04-11 17:29  自制符号选择器\Properties\Settings.Designer.cs

     文件        249  2011-04-11 17:29  自制符号选择器\Properties\Settings.settings

     文件       5764  2011-04-12 10:06  自制符号选择器\自制符号选择器.csproj

     文件      17366  2011-05-19 14:54  自制符号选择器\选择符号.cs

     文件      15131  2011-04-12 18:14  自制符号选择器\选择符号.Designer.cs

     文件       7134  2011-04-12 13:48  自制符号选择器\选择符号.resx

     文件        953  2011-04-11 17:29  自制符号选择器.sln

    ..A..H.     19456  2011-05-19 14:54  自制符号选择器.suo

     目录          0  2011-04-11 17:53  自制符号选择器\obj\Debug\Refactor

     目录          0  2011-04-11 17:29  自制符号选择器\obj\Debug\TempPE

     目录          0  2011-04-11 17:47  自制符号选择器\bin\Debug

............此处省略8个文件信息

评论

共有 条评论