Пример #1
0
        //yjl20110826 add
        private ISymbol[] CreateSymbols(int count)
        {
            IColorRamp pColorRamp = (cmbColorRamp.SelectedItem as DevComponents.Editors.ComboItem).Tag as IColorRamp;
            bool       bCreateRamp;

            pColorRamp.Size = count <= 1 ? 2 : count;
            pColorRamp.CreateRamp(out bCreateRamp);
            IEnumColors enumColors = pColorRamp.Colors;

            enumColors.Reset();
            ESRI.ArcGIS.esriSystem.IObjectCopy copy = new ESRI.ArcGIS.esriSystem.ObjectCopyClass();
            ISymbol[] symbols   = new ISymbol[count];
            ISymbol   tmpSymbol = ModuleCommon.CreateSymbol(m_SymbologyStyleClass);

            for (int i = 0; i < count; i++)
            {
                symbols[i] = copy.Copy(tmpSymbol) as ISymbol;
                IColor pColor = enumColors.Next();
                if (pColor == null)
                {
                    enumColors.Reset();
                    enumColors.Next();
                }
                ModuleCommon.ChangeSymbolColor(symbols[i], pColor);
            }
            return(symbols);
        }
Пример #2
0
        public void InitRendererObject(IFeatureLayer pFeatureLayer, IFeatureRenderer pRenderer, esriSymbologyStyleClass _SymbologyStyleClass)
        {
            List <FieldInfo> fields = ModuleCommon.GetFieldsFromLayer(pFeatureLayer, true);

            m_Layer = pFeatureLayer;
            InitRendererObject(fields, pRenderer, _SymbologyStyleClass);
        }
Пример #3
0
        private ISymbol[] CreateSymbols()
        {
            IColorRamp pColorRamp = (cmbColorRamp.SelectedItem as DevComponents.Editors.ComboItem).Tag as IColorRamp;
            bool       bCreateRamp;

            pColorRamp.Size = levelInput.Value <= 1 ? 2 : levelInput.Value;
            pColorRamp.CreateRamp(out bCreateRamp);
            IEnumColors enumColors = pColorRamp.Colors;

            enumColors.Reset();

            ISymbol[] symbols = new ISymbol[levelInput.Value];
            ESRI.ArcGIS.esriSystem.IObjectCopy copy = new ESRI.ArcGIS.esriSystem.ObjectCopyClass();
            for (int i = 0; i < levelInput.Value; i++)
            {
                symbols[i] = copy.Copy(labelPreviewFore.Tag) as ISymbol;
                IColor pColor = enumColors.Next();
                if (pColor == null)
                {
                    enumColors.Reset();
                    enumColors.Next();
                }
                ModuleCommon.ChangeSymbolColor(symbols[i], pColor);
            }
            return(symbols);
        }
Пример #4
0
        private void RefreshSymbol()
        {//ˢзûºÅÑùʽ
            if (flag)
            {
                return;
            }
            ESRI.ArcGIS.esriSystem.IObjectCopy copy = new ESRI.ArcGIS.esriSystem.ObjectCopyClass();
            listAddField.SmallImageList.Images.Clear();

            for (int i = 0; i < listAllField.Items.Count; i++)
            {
                ISymbol pSymbol = copy.Copy(labelPreviewBack.Tag) as ISymbol;
                IColor  pColor  = ModuleCommon.GetColor(listAllField.Items[i].Tag as ISymbol);
                ModuleCommon.ChangeSymbolColor(pSymbol, pColor);
                listAllField.Items[i].Tag = pSymbol;
            }

            for (int i = 0; i < listAddField.Items.Count; i++)
            {
                ISymbol pSymbol = copy.Copy(labelPreviewBack.Tag) as ISymbol;
                IColor  pColor  = ModuleCommon.GetColor(listAddField.Items[i].Tag as ISymbol);
                ModuleCommon.ChangeSymbolColor(pSymbol, pColor);
                listAddField.Items[i].Tag = pSymbol;
                listAddField.SmallImageList.Images.Add(listAddField.Items[i].Name.Replace("Item", "Symbol"),
                                                       ModuleCommon.Symbol2Picture(pSymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));
                listAddField.Items[i].ImageKey = listAddField.Items[i].Name.Replace("Item", "Symbol");
                listAddField.Refresh();
            }
        }
Пример #5
0
        private void RefreshColorRamp()
        {//刷新符号颜色
            if (flag)
            {
                return;
            }
            IColorRamp pColorRamp = (cmbColorRamp.SelectedItem as DevComponents.Editors.ComboItem).Tag as IColorRamp;
            bool       bCreateRamp;

            pColorRamp.Size = levelInput.Value <= 1 ? 2 : levelInput.Value;
            pColorRamp.CreateRamp(out bCreateRamp);
            IEnumColors enumColors = pColorRamp.Colors;

            enumColors.Reset();
            listValueItem.SmallImageList.Images.Clear();
            for (int i = 0; i < listValueItem.Items.Count; i++)
            {
                IColor pColor = enumColors.Next();
                if (pColor == null)
                {
                    enumColors.Reset();
                    enumColors.Next();
                }

                System.Windows.Forms.ListViewItem item = listValueItem.Items[i];
                ModuleCommon.ChangeSymbolColor(item.Tag as ISymbol, pColor);
                listValueItem.SmallImageList.Images.Add(item.Name.Replace("Item", "Symbol"),
                                                        ModuleCommon.Symbol2Picture(item.Tag as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));
                listValueItem.Items[i].ImageKey = item.Name.Replace("Item", "Symbol");
            }
        }
Пример #6
0
 //简单渲染
 public static ESRI.ArcGIS.Carto.IFeatureRenderer CreateSimpleRenderer(esriSymbologyStyleClass _SymbologyStyleClass)
 {
     ESRI.ArcGIS.Carto.ISimpleRenderer pSimpleRenderer = new ESRI.ArcGIS.Carto.SimpleRendererClass();
     pSimpleRenderer.Description = "";
     pSimpleRenderer.Label       = "";
     pSimpleRenderer.Symbol      = ModuleCommon.CreateSymbol(_SymbologyStyleClass);
     return(pSimpleRenderer as ESRI.ArcGIS.Carto.IFeatureRenderer);
 }
Пример #7
0
        private static ISymbol CreateMarkerSym()
        {
            IRgbColor pColor = new RgbColorClass();

            pColor.Red   = 0;
            pColor.Green = 0;
            pColor.Blue  = 0;
            return(ModuleCommon.CreateMarkerSym(0, 2, pColor, 0, 0));
        }
Пример #8
0
 /// <summary>
 /// 从二进制获取符号方案
 /// </summary>
 /// <param name="renderValue"></param>
 /// <returns></returns>
 private ESRI.ArcGIS.Carto.IRasterRenderer  GetRasterRenderer(byte[] renderValue, string rendererType)
 {
     ESRI.ArcGIS.Carto.IRasterRenderer pRenderer = ModuleCommon.LoadRasterRendererFromByte(renderValue, rendererType);
     if (pRenderer == null)
     {
         pRenderer = ModuleCommon.CreateStretchColorRampRenderer();
     }
     return(pRenderer);
 }
Пример #9
0
        private static ISymbol CreateLineSym()
        {
            IRgbColor pColor = new RgbColorClass();

            pColor.Red   = 0;
            pColor.Green = 0;
            pColor.Blue  = 0;
            return(ModuleCommon.CreateLineSym(pColor, 1, 0));
        }
Пример #10
0
 /// <summary>
 /// 从二进制获取符号方案
 /// </summary>
 /// <param name="renderValue"></param>
 /// <returns></returns>
 private ESRI.ArcGIS.Carto.IFeatureRenderer GetRenderer(byte[] renderValue, string rendererType)
 {
     ESRI.ArcGIS.Carto.IFeatureRenderer pRenderer = ModuleCommon.LoadRendererFromByte(renderValue, rendererType);
     if (pRenderer == null)
     {
         pRenderer = ModuleCommon.CreateSimpleRenderer(m_StyleClass);
     }
     return(pRenderer);
 }
Пример #11
0
 public void DoAfterEdit(object newValue, System.Windows.Forms.DialogResult result, string editType)
 {
     if (result != System.Windows.Forms.DialogResult.OK)
     {
         m_EditObject = null;
         return;
     }
     if (m_EditObject is System.Windows.Forms.ListViewItem.ListViewSubItem)
     {
         System.Windows.Forms.ListViewItem.ListViewSubItem subItem =
             m_EditObject as System.Windows.Forms.ListViewItem.ListViewSubItem;
         if (subItem.Name.Contains("Range"))//范围编辑
         {
             #region Range
             //更新当前编辑对象(Range)的值
             subItem.Tag  = newValue;
             subItem.Text = subItem.Text.Split('-')[0] + "-" + newValue.ToString();
             //更新对应的Label的值
             string nameIndex = subItem.Name.Replace("Range", "");
             #endregion
         }
         else if (subItem.Name.Contains("Label"))//标签编辑
         {
             if (newValue.ToString() != "")
             {
                 subItem.Tag  = newValue;
                 subItem.Text = newValue.ToString();
             }
         }
     }
     if (m_EditObject is System.Windows.Forms.ListViewItem)
     {
         System.Windows.Forms.ListViewItem item = m_EditObject as System.Windows.Forms.ListViewItem;
         item.Tag = newValue;
         ModuleCommon.Symbol2Picture(newValue as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight);
         item.ImageKey = "Symbol" + item.Index.ToString();
     }
     if (m_EditObject is DevComponents.DotNetBar.LabelX)
     {
         DevComponents.DotNetBar.LabelX label = m_EditObject as DevComponents.DotNetBar.LabelX;
         switch (label.Name)
         {
         case "labelPreviewFore":
             if (label.Image != null)
             {
                 label.Image.Dispose();
                 label.Image = null;
             }
             label.Tag   = newValue;
             label.Image = ModuleCommon.Symbol2Picture(newValue as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight);
             //RefreshSymbol();
             break;
         }
     }
     m_EditObject = null;
 }
Пример #12
0
        //唯一值渲染
        public static ESRI.ArcGIS.Carto.IFeatureRenderer CreateUVRenderer(esriSymbologyStyleClass _SymbologyStyleClass)
        {
            ESRI.ArcGIS.Carto.IUniqueValueRenderer pUVRenderer = new ESRI.ArcGIS.Carto.UniqueValueRendererClass();
            pUVRenderer.FieldCount = 0;

            pUVRenderer.DefaultLabel  = "<All Other Values>";
            pUVRenderer.ColorScheme   = "";
            pUVRenderer.DefaultSymbol = ModuleCommon.CreateSymbol(_SymbologyStyleClass);
            return(pUVRenderer as ESRI.ArcGIS.Carto.IFeatureRenderer);
        }
Пример #13
0
        private void CreateRendererObject(string typeString)
        {
            if (m_RendererObject.ContainsKey(typeString))
            {
                return;
            }
            try
            {
                Type type = Type.GetType(typeString);
                if (type == null)
                {
                    return;
                }
                IRendererUI rendererObject = Activator.CreateInstance(type) as IRendererUI;

                ESRI.ArcGIS.Carto.IFeatureRenderer pRenderer = null;
                switch (rendererObject.RendererType)
                {
                case enumRendererType.SimpleRenderer:
                    pRenderer = ModuleCommon.CreateSimpleRenderer(m_StyleClass);
                    break;

                case enumRendererType.UniqueValueRenderer:
                    pRenderer = ModuleCommon.CreateUVRenderer(m_StyleClass);
                    break;

                case enumRendererType.BreakColorRenderer:
                    pRenderer = ModuleCommon.CreateBreakColorRenderer(m_StyleClass);
                    break;

                case enumRendererType.BreakSizeRenderer:
                    pRenderer = ModuleCommon.CreateBreakSizeRenderer(m_StyleClass);
                    break;

                case enumRendererType.ChartRenderer:
                    pRenderer = ModuleCommon.CreateChartRenderer(m_StyleClass);    //yjl20110830 add
                    break;
                }

                if (m_FeatureLayer == null)
                {
                    rendererObject.InitRendererObject(m_FieldInfo, pRenderer, m_StyleClass);
                }
                else
                {
                    rendererObject.InitRendererObject(m_FeatureLayer, pRenderer, m_StyleClass);
                }
                m_RendererObject.Add(typeString, rendererObject);
            }
            catch (Exception ex)
            {
            }
        }
Пример #14
0
        public void FeatureRenderer(ref byte[] pRenderValue, ref string pRenderType)
        {
            if (this.DialogResult != DialogResult.OK)
            {
                pRenderValue = null;
                pRenderType  = string.Empty;
                return;
            }
            string typeString = treeCatelog.SelectedNode.DataKey.ToString();

            ModuleCommon.SaveRendererToByte(ref pRenderValue, ref pRenderType, m_RendererObject[typeString]);
        }
Пример #15
0
        private void RefreshItems()
        {
            if (cmbField.Text == "<NONE>")
            {
                return;
            }
            if (levelInput.Value < 1)
            {
                return;
            }
            if (minSizeInput.Value <= 0 || maxSizeInput.Value <= 0)
            {
                return;
            }

            listValueItem.Items.Clear();
            listValueItem.SmallImageList.Images.Clear();
            double sizeInterval  = (maxSizeInput.Value - minSizeInput.Value) / levelInput.Value;
            double valueInterval = GetValueInterval(cmbField.Name);

            ISymbol[] symbols = CreateSymbols();
            for (int i = 0; i < levelInput.Value; i++)
            {
                listValueItem.SmallImageList.Images.Add("Symbol" + i.ToString(), ModuleCommon.Symbol2Picture(symbols[i], ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));

                System.Windows.Forms.ListViewItem item = new System.Windows.Forms.ListViewItem();
                item.Name     = "Item" + i.ToString();
                item.Text     = "";
                item.ImageKey = "Symbol" + i.ToString();
                item.Tag      = symbols[i];

                double sMinValue = minValueInput.Value + valueInterval * i;
                double sMaxValue = minValueInput.Value + valueInterval * (i + 1);
                sMinValue = Math.Round(sMinValue, 4);
                sMaxValue = Math.Round(sMaxValue, 4);

                System.Windows.Forms.ListViewItem.ListViewSubItem subItem = new System.Windows.Forms.ListViewItem.ListViewSubItem();
                subItem.Name = "Range" + i.ToString();
                subItem.Text = (sMinValue == 0 ? "0" : sMinValue.ToString()) + "-" + (sMaxValue == 0 ? "0" : sMaxValue.ToString());
                subItem.Tag  = sMaxValue;
                item.SubItems.Add(subItem);

                System.Windows.Forms.ListViewItem.ListViewSubItem subItem1 = new System.Windows.Forms.ListViewItem.ListViewSubItem();
                subItem1.Name = "Label" + i.ToString();
                subItem1.Text = (sMinValue == 0 ? "0" : sMinValue.ToString()) + "-" + (sMaxValue == 0 ? "0" : sMaxValue.ToString());
                item.SubItems.Add(subItem1);

                listValueItem.Items.Add(item);
            }
            listValueItem.Refresh();
        }
Пример #16
0
        private ISymbol[] CreateSymbols()
        {
            double sizeInterval = (maxSizeInput.Value - minSizeInput.Value) / levelInput.Value;

            ISymbol[] symbols = new ISymbol[levelInput.Value];
            ESRI.ArcGIS.esriSystem.IObjectCopy copy = new ESRI.ArcGIS.esriSystem.ObjectCopyClass();
            for (int i = 0; i < levelInput.Value; i++)
            {
                double size = minSizeInput.Value + sizeInterval * i;
                symbols[i] = copy.Copy(labelPreviewFore.Tag) as ISymbol;
                ModuleCommon.ChangeSymbolSize(symbols[i], size);
            }
            return(symbols);
        }
Пример #17
0
 public void DoAfterEdit(object newValue, System.Windows.Forms.DialogResult result, string editType)
 {
     if (m_EditObject is DevDNB.LabelX)
     {
         labelPreviewFore.Tag = newValue;
         if (labelPreviewFore.Image != null)
         {
             labelPreviewFore.Image.Dispose();
             labelPreviewFore.Image = null;
         }
         labelPreviewFore.Image = ModuleCommon.Symbol2Picture(newValue as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight);
     }
     m_EditObject = null;
 }
Пример #18
0
        private ISymbol[] CreateSymbols()
        {
            double sizeInterval = (m_MaxSize.DataValue - m_MinSize.DataValue) / m_SizeLevel.DataValue;

            ISymbol[] symbols = new ISymbol[m_SizeLevel.DataValue];
            ESRI.ArcGIS.esriSystem.IObjectCopy copy = new ESRI.ArcGIS.esriSystem.ObjectCopyClass();
            for (int i = 0; i < m_SizeLevel.DataValue; i++)
            {
                double size = m_MinSize.DataValue + sizeInterval * i;
                symbols[i] = copy.Copy(m_ForeSymbol.DataValue) as ISymbol;
                ModuleCommon.ChangeSymbolSize(symbols[i], size);
            }
            return(symbols);
        }
Пример #19
0
        /// <summary>
        /// 从图层获取符号方案
        /// </summary>
        /// <param name="pLayer"></param>
        /// <returns></returns>
        private ESRI.ArcGIS.Carto.IFeatureRenderer GetRenderer(ESRI.ArcGIS.Carto.IFeatureLayer pLayer)
        {
            if (pLayer == null)
            {
                return(ModuleCommon.CreateSimpleRenderer(m_StyleClass));
            }
            ESRI.ArcGIS.Carto.IGeoFeatureLayer pGeoLayer = pLayer as ESRI.ArcGIS.Carto.IGeoFeatureLayer;
            if (pGeoLayer == null || pGeoLayer.Renderer == null)
            {
                return(ModuleCommon.CreateSimpleRenderer(m_StyleClass));
            }

            return(pGeoLayer.Renderer);
        }
Пример #20
0
        private void CreateRendererObject(string typeString)
        {
            if (m_RendererObject.ContainsKey(typeString))
            {
                return;
            }
            try
            {
                Type type = Type.GetType(typeString);
                if (type == null)
                {
                    return;
                }
                IRasterRendererUI rendererObject = Activator.CreateInstance(type) as IRasterRendererUI;

                ESRI.ArcGIS.Carto.IRasterRenderer pRasterRenderer = null;
                switch (rendererObject.RasterRendererType)
                {
                case enumRasterRendererType.StretchColorRampRenderer:
                    pRasterRenderer = ModuleCommon.CreateStretchColorRampRenderer();
                    break;

                case enumRasterRendererType.ClassifyColorRampRenderer:
                    pRasterRenderer = ModuleCommon.CreateClassifyColorRampRenderer();
                    break;

                case enumRasterRendererType.UniqueValueRenderer:
                    pRasterRenderer = ModuleCommon.CreateUniqueValueRasterRenderer();
                    break;

                case enumRasterRendererType.RGBRenderer:
                    pRasterRenderer = ModuleCommon.CreateRGBRenderer();
                    break;
                }

                if (_Layer == null)
                {
                    rendererObject.InitRasterRendererObject(m_FieldInfo, pRasterRenderer);
                }
                else
                {
                    rendererObject.InitRasterRendererObject(_Layer, pRasterRenderer);
                }
                m_RendererObject.Add(typeString, rendererObject);
            }
            catch (Exception ex)
            {
            }
        }
Пример #21
0
        private static ISymbol CreateFillSym()
        {
            IRgbColor pOutlineColor = new RgbColorClass();

            pOutlineColor.Red   = 0;
            pOutlineColor.Green = 0;
            pOutlineColor.Blue  = 0;

            IRgbColor pFillColor = new RgbColorClass();

            pFillColor.Red   = 128;
            pFillColor.Green = 255;
            pFillColor.Blue  = 128;
            return(ModuleCommon.CreateFillSym(pFillColor, 0.1, pOutlineColor));
        }
Пример #22
0
        private void InitRendererObject(IFeatureRenderer pRenderer, esriSymbologyStyleClass _SymbologyStyleClass)
        {
            m_SymbologyStyleClass = _SymbologyStyleClass;
            ISimpleRenderer pSimpleRenderer = pRenderer as ISimpleRenderer;

            txtName.Text = pSimpleRenderer.Label;
            txtDesc.Text = pSimpleRenderer.Description;
            if (pSimpleRenderer.Symbol == null)
            {
                labelPreviewFore.Tag = ModuleCommon.CreateSymbol(m_SymbologyStyleClass);
            }
            else
            {
                labelPreviewFore.Tag = pSimpleRenderer.Symbol;
            }
            labelPreviewFore.Image = ModuleCommon.Symbol2Picture(labelPreviewFore.Tag as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight);
        }
Пример #23
0
        //分级大小渲染
        public static ESRI.ArcGIS.Carto.IFeatureRenderer CreateBreakSizeRenderer(esriSymbologyStyleClass _SymbologyStyleClass)
        {
            ESRI.ArcGIS.Carto.IClassBreaksRenderer pBreakRenderer = new ESRI.ArcGIS.Carto.ClassBreaksRendererClass();
            pBreakRenderer.Field        = "<NONE>";
            pBreakRenderer.MinimumBreak = 0;
            pBreakRenderer.BreakCount   = 0;
            if (_SymbologyStyleClass == esriSymbologyStyleClass.esriStyleClassFillSymbols)
            {
                pBreakRenderer.BackgroundSymbol = ModuleCommon.CreateSymbol(esriSymbologyStyleClass.esriStyleClassMarkerSymbols) as IFillSymbol;
            }
            else
            {
                pBreakRenderer.BackgroundSymbol = null;
            }

            return(pBreakRenderer as ESRI.ArcGIS.Carto.IFeatureRenderer);
        }
Пример #24
0
        public frmChartRenderer()
        {
            InitializeComponent();
            this.Dock    = System.Windows.Forms.DockStyle.Fill;
            m_EditObject = null;
            listAddField.SmallImageList           = new System.Windows.Forms.ImageList();
            listAddField.SmallImageList.ImageSize = new System.Drawing.Size(ModuleCommon.ImageWidth, ModuleCommon.ImageHeight);

            System.Windows.Forms.ColumnHeader column1 = new System.Windows.Forms.ColumnHeader();
            column1.Name      = "Field";
            column1.Text      = "×Ö¶Î";
            column1.Width     = 140;
            column1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
            listAllField.Columns.Add(column1);

            System.Windows.Forms.ColumnHeader column2 = new System.Windows.Forms.ColumnHeader();
            column2.Name      = "Symbol";
            column2.Text      = "·ûºÅ";
            column2.Width     = 80;
            column2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            listAddField.Columns.Add(column2);

            column2           = new System.Windows.Forms.ColumnHeader();
            column2.Name      = "Field";
            column2.Text      = "×Ö¶Î";
            column2.Width     = 130;
            column2.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
            listAddField.Columns.Add(column2);

            List <ColorItem> colorRamps = new ModuleCommon().GetColorScheme(217, 20, "Default Schemes;Spatial Ramps");

            for (int i = 0; i < colorRamps.Count; i++)
            {
                DevComponents.Editors.ComboItem item = new DevComponents.Editors.ComboItem();
                item.Image = colorRamps[i].ColorImage;
                item.Text  = colorRamps[i].Name;
                item.Tag   = colorRamps[i].ColorRamp;
                cmbColorRamp.Items.Add(item);
            }
            flag = true;
            cmbColorRamp.SelectedIndex = 0;
            flag = false;
        }
Пример #25
0
        public frmBreakColorRenderer()
        {
            InitializeComponent();
            this.Dock    = System.Windows.Forms.DockStyle.Fill;
            m_EditObject = null;
            listValueItem.SmallImageList           = new System.Windows.Forms.ImageList();
            listValueItem.SmallImageList.ImageSize = new System.Drawing.Size(ModuleCommon.ImageWidth, ModuleCommon.ImageHeight);

            System.Windows.Forms.ColumnHeader column = new System.Windows.Forms.ColumnHeader();
            column.Name      = "Symbol";
            column.Text      = "符号";
            column.Width     = 80;
            column.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
            listValueItem.Columns.Add(column);

            column           = new System.Windows.Forms.ColumnHeader();
            column.Name      = "Range";
            column.Text      = "范围";
            column.Width     = 146;
            column.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
            listValueItem.Columns.Add(column);

            column           = new System.Windows.Forms.ColumnHeader();
            column.Name      = "Label";
            column.Text      = "标签";
            column.Width     = 146;
            column.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
            listValueItem.Columns.Add(column);

            List <ColorItem> colorRamps = new ModuleCommon().GetColorScheme(217, 20, "Default Ramps;Dichromatic Ramps");

            for (int i = 0; i < colorRamps.Count; i++)
            {
                DevComponents.Editors.ComboItem item = new DevComponents.Editors.ComboItem();
                item.Image = colorRamps[i].ColorImage;
                item.Text  = colorRamps[i].Name;
                item.Tag   = colorRamps[i].ColorRamp;
                cmbColorRamp.Items.Add(item);
            }
            flag = true;
            cmbColorRamp.SelectedIndex = 0;
            flag = false;
        }
Пример #26
0
        private void RefreshSize()
        {
            if (flag)
            {
                return;
            }
            double sizeInterval = (maxSizeInput.Value - minSizeInput.Value) / levelInput.Value;

            listValueItem.SmallImageList.Images.Clear();
            for (int i = 0; i < listValueItem.Items.Count; i++)
            {
                System.Windows.Forms.ListViewItem item = listValueItem.Items[i];
                double size = minSizeInput.Value + sizeInterval * i;
                ModuleCommon.ChangeSymbolSize(item.Tag as ISymbol, size);
                listValueItem.SmallImageList.Images.Add(item.Name.Replace("Item", "Symbol"),
                                                        ModuleCommon.Symbol2Picture(item.Tag as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));
                item.ImageKey = item.Name.Replace("Item", "Symbol");
            }
        }
Пример #27
0
        private void DoListViewMouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs e)
        {
            DevComponents.DotNetBar.Controls.ListViewEx listView = sender as DevComponents.DotNetBar.Controls.ListViewEx;
            System.Windows.Forms.ListViewItem           item     = null;
            if (item == null)
            {
                return;
            }
            switch (listView.Name)
            {
            case "listAddField":
            {
                item = listAddField.GetItemAt(e.X, e.Y);
                System.Drawing.Rectangle rec = item.GetBounds(System.Windows.Forms.ItemBoundsPortion.Entire);
                if (e.X <= listAddField.Columns[0].Width)
                {
                    m_EditObject = item;
                    Form.frmSymbolEdit frm = new GeoSymbology.Form.frmSymbolEdit(this, item.Tag as ISymbol, "");
                    frm.ShowDialog();
                }
                else if (e.X > listAddField.Columns[0].Width && e.X <=
                         listAddField.Columns[0].Width + listAddField.Columns[1].Width)
                {
                    listAddField.Items.Remove(item);
                    item.ImageKey = "";
                    listAllField.Items.Add(item);
                }
            }
            break;

            case "listAllField":
            {
                item = listAllField.GetItemAt(e.X, e.Y);
                listAllField.Items.Remove(item);
                listAddField.Items.Add(item);
                listAddField.SmallImageList.Images.Add(item.Name.Replace("Item", "Symbol"),
                                                       ModuleCommon.Symbol2Picture(item.Tag as ISymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));
                item.ImageKey = item.Name.Replace("Item", "Symbol");
            }
            break;
            }
        }
Пример #28
0
        public void DoAfterEdit(object newValue, System.Windows.Forms.DialogResult result, string editType)
        {
            if (result != System.Windows.Forms.DialogResult.OK)
            {
                m_EditObject = null;
                return;
            }

            if (m_EditObject is DevComponents.DotNetBar.ButtonX)
            {
                DevComponents.DotNetBar.ButtonX button = m_EditObject as DevComponents.DotNetBar.ButtonX;
                m_ForeSymbol.DataValue = newValue as ISymbol;
                if (button.Image != null)
                {
                    button.Image.Dispose();
                    button.Image = null;
                }
                button.Image = ModuleCommon.Symbol2Picture(m_ForeSymbol.DataValue, 80, 40);
            }
        }
Пример #29
0
 private void RefreshSymbol()
 {//刷新符号样式
     if (flag)
     {
         return;
     }
     ESRI.ArcGIS.esriSystem.IObjectCopy copy = new ESRI.ArcGIS.esriSystem.ObjectCopyClass();
     listValueItem.SmallImageList.Images.Clear();
     for (int i = 0; i < listValueItem.Items.Count; i++)
     {
         ISymbol pSymbol = copy.Copy(labelPreviewFore.Tag) as ISymbol;
         double  size    = ModuleCommon.GetSymbolSize(listValueItem.Items[i].Tag as ISymbol);
         ModuleCommon.ChangeSymbolSize(pSymbol, size);
         listValueItem.Items[i].Tag = pSymbol;
         listValueItem.SmallImageList.Images.Add(listValueItem.Items[i].Name.Replace("Item", "Symbol"),
                                                 ModuleCommon.Symbol2Picture(pSymbol, ModuleCommon.ImageWidth, ModuleCommon.ImageHeight));
         listValueItem.Items[i].ImageKey = listValueItem.Items[i].Name.Replace("Item", "Symbol");
     }
     listValueItem.Refresh();
 }
Пример #30
0
        public frmStretchColorRampRenderer()
        {
            InitializeComponent();
            this.Dock    = System.Windows.Forms.DockStyle.Fill;
            m_EditObject = null;

            List <ColorItem> colorRamps = new ModuleCommon().GetColorScheme(297, 20, "Default Ramps;Dichromatic Ramps");

            for (int i = 0; i < colorRamps.Count; i++)
            {
                DevComponents.Editors.ComboItem item = new DevComponents.Editors.ComboItem();
                item.Image = colorRamps[i].ColorImage;
                item.Text  = colorRamps[i].Name;
                item.Tag   = colorRamps[i].ColorRamp;
                cmbColorRamp.Items.Add(item);
            }
            flag = true;
            cmbColorRamp.SelectedIndex = 0;
            flag = false;
        }