Ejemplo n.º 1
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");
            }
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
            }
        }