//选择样式,图片框中预览
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     pStyleGalleryItem = e.styleGalleryItem as IStyleGalleryItem;
     //object objSymbol = pStyleGallery.Item;
     //SympleToView((ISymbol)styleGallery.Item);
     PreviewImage();
 }
Example #2
0
        //样式选择
        private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            //选择样式
            StyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;

            PreviewImage();
        }
Example #3
0
        //样式选择
        private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            //选择样式
            pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            //将选择的样式与设计的样式大小、颜色等属性结合
            if (axSymbologyControl.StyleClass == esriSymbologyStyleClass.esriStyleClassMarkerSymbols)
            {
                IMarkerSymbol pMarkerSymbol = pStyleGalleryItem.Item as IMarkerSymbol;
                double        pMarkerSize   = pMarkerSymbol.Size;
                PointSize.Text = pMarkerSize.ToString();
                double pMarkerAngle = pMarkerSymbol.Angle;
                PointAngle.Text          = pMarkerAngle.ToString();
                colorPoint.SelectedColor = ClsGDBDataCommon.IColorToColor(pMarkerSymbol.Color);
            }
            else if (axSymbologyControl.StyleClass == esriSymbologyStyleClass.esriStyleClassLineSymbols)
            {
                ILineSymbol pLineSymbol = pStyleGalleryItem.Item as ILineSymbol;
                double      pLineWidth  = pLineSymbol.Width;
                LineSize.Text = pLineWidth.ToString();

                colorLine.SelectedColor = ClsGDBDataCommon.IColorToColor(pLineSymbol.Color);
            }
            else if (axSymbologyControl.StyleClass == esriSymbologyStyleClass.esriStyleClassFillSymbols)
            {
                IFillSymbol pFillSymbol = pStyleGalleryItem.Item as IFillSymbol;

                PolygonSize.Text           = pFillSymbol.Outline.Width.ToString();
                colorPolygon.SelectedColor = ClsGDBDataCommon.IColorToColor(pFillSymbol.Color);
                colorOutLine.SelectedColor = ClsGDBDataCommon.IColorToColor(pFillSymbol.Outline.Color);
            }
            PreviewImage();
        }
Example #4
0
        /*axSymbologyControl控件事件
         *
         */
        private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            IStyleGalleryItem selectItem = e.styleGalleryItem as IStyleGalleryItem;

            LabelName.Text = "名称:" + selectItem.Name + "\nID:" + selectItem.ID + "\n类型:" + selectItem.Category;
            previewSymbol(selectItem.Item);
        }
Example #5
0
        private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            Selector.StyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            object objSymbol = Selector.StyleGalleryItem.Item;

            switch (axSymbologyControl1.StyleClass)
            {
            case esriSymbologyStyleClass.esriStyleClassMarkerSymbols:    //点符号
                btnColor.BackColor = ((IMarkerSymbol)objSymbol).Color.ToColor();
                nudAngle.Value     = (decimal)((IMarkerSymbol)objSymbol).Angle;
                nudSize.Value      = (decimal)((IMarkerSymbol)objSymbol).Size;
                break;

            case esriSymbologyStyleClass.esriStyleClassLineSymbols:     //线符号
                btnColor.BackColor = ((ILineSymbol)objSymbol).Color.ToColor();
                nudWidth.Value     = (decimal)((ILineSymbol)objSymbol).Width;
                break;

            case esriSymbologyStyleClass.esriStyleClassFillSymbols:     //面符号
                btnColor.BackColor = ((IFillSymbol)objSymbol).Color.ToColor();
                ILineSymbol outline = ((IFillSymbol)objSymbol).Outline;
                btnOutlineColor.BackColor = outline.Color.ToColor();
                nudWidth.Value            = (decimal)outline.Width;
                break;

            default:
                btnColor.BackColor = Color.Black;
                break;
            }
            PreviewImage();
        }
        //axSymbologyControl空间SymbolItem选中事件相应函数
        private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            pStyleGalleryItem = e.styleGalleryItem as IStyleGalleryItem;    //获取选择项
            PreviewPicture();                                               //在图片框中显示
            //点,将属性传递到调节的控件上
            if (((IFeatureLayer)pLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)
            {
                  
                {
                    IRgbColor pColor = ((IMarkerSymbol)pStyleGalleryItem.Item).Color as IRgbColor;

                    btColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);            //颜色
                    nudAngle.Value    = Convert.ToDecimal(((IMarkerSymbol)pStyleGalleryItem.Item).Angle); //角度
                    nudWidth.Value    = Convert.ToDecimal(((IMarkerSymbol)pStyleGalleryItem.Item).Size);  //大小
                }
            }
            //线
            if (((IFeatureLayer)pLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline)
            {
                IRgbColor pColor = ((ILineSymbol)pStyleGalleryItem.Item).Color as IRgbColor;
                btColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);          //颜色
                nudWidth.Value    = Convert.ToDecimal(((ILineSymbol)pStyleGalleryItem.Item).Width); //宽度
            }
            //面
            if (((IFeatureLayer)pLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
            {
                IRgbColor pColor = ((IFillSymbol)pStyleGalleryItem.Item).Color as IRgbColor;
                btColor.BackColor        = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);                  //填充色
                nudWidth.Value           = Convert.ToDecimal(((IFillSymbol)pStyleGalleryItem.Item).Outline.Width); //边框宽度
                pColor                   = ((IFillSymbol)pStyleGalleryItem.Item).Outline.Color as IRgbColor;
                btOutlineColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);                  //边框颜色
            }
        }
Example #7
0
        private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            Color color;

            switch (this.axSymbologyControl.StyleClass)
            {
            case esriSymbologyStyleClass.esriStyleClassMarkerSymbols:
                color = this.ConvertIRgbColorToColor(((IMarkerSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                break;

            case esriSymbologyStyleClass.esriStyleClassLineSymbols:
                color = this.ConvertIRgbColorToColor(((ILineSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                break;

            case esriSymbologyStyleClass.esriStyleClassFillSymbols:
                color = this.ConvertIRgbColorToColor(((IFillSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                this.btnOutlineColor.BackColor = this.ConvertIRgbColorToColor(((IFillSymbol)pStyleGalleryItem.Item).Outline.Color as IRgbColor);
                break;

            default:
                color = Color.Black;
                break;
            }
            this.btnColor.BackColor = color;
            this.PreviewImage();
        }
Example #8
0
        private void SymbolCtrl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            m_SelStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            m_CurSymbol           = (ISymbol)m_SelStyleGalleryItem.Item;
            if (m_SymbolXmlElement != null)
            {
                m_SymbolXmlElement.SetAttribute("符号名", m_SelStyleGalleryItem.Name);
            }

            PreviewSymbol(m_CurSymbol);

            ChangeControls();
        }
Example #9
0
        //选择样式
        private void axSymbologyCtlLegendItem_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            //择样式
            pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            ILegendItem pLegendTemp = pStyleGalleryItem.Item as ILegendItem;

            pLegendItem.ShowLayerName    = pLegendTemp.ShowLayerName;
            pLegendItem.ShowLabels       = pLegendTemp.ShowLabels;
            pLegendItem.ShowHeading      = pLegendTemp.ShowHeading;
            pLegendItem.ShowDescriptions = pLegendTemp.ShowDescriptions;
            pStyleGalleryItem.Item       = pLegendItem;
            //pLegendItem = pStyleGalleryItem.Item as ILegendItem;
            PreviewImage();
        }
Example #10
0
        private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            button2.Enabled     = true;
            m_pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            if (m_pStyleGalleryItem == null)
            {
                return;
            }
            //获取新的指北针
            this.PreviewImage();
            IScaleBar pScaleBar = m_pStyleGalleryItem.Item as IScaleBar;

            txtBoxUnit.Text = pScaleBar.Units.ToString();
        }
Example #11
0
        /// <summary>
        /// 选中符号时触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SymbologyCtr_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            Color color;

            switch (this.SymbologyCtr.StyleClass)
            {
            //点符号

            case esriSymbologyStyleClass.esriStyleClassMarkerSymbols:
                color = this.ConvertIRgbColorToColor(((IMarkerSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                //设置按钮背景色
                this.btnColor.BackColor = color;
                //设置点符号角度和大小初始值
                this.nudAngle.Value = (decimal)((IMarkerSymbol)this.pStyleGalleryItem.Item).Angle;
                this.nudSize.Value  = (decimal)((IMarkerSymbol)this.pStyleGalleryItem.Item).Size;
                break;

            //线符号
            case esriSymbologyStyleClass.esriStyleClassLineSymbols:
                color = this.ConvertIRgbColorToColor(((ILineSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                //设置按钮背景色
                this.btnColor.BackColor = color;
                //设置线宽初始值
                this.nudWidth.Value = (decimal)((ILineSymbol)this.pStyleGalleryItem.Item).Width;
                break;

            //面符号
            case esriSymbologyStyleClass.esriStyleClassFillSymbols:
                //如果面符号选中的颜色不为渐变色,则设置按钮背景颜色
                if (((IFillSymbol)pStyleGalleryItem.Item).Color as IRgbColor != null)
                {
                    color = this.ConvertIRgbColorToColor(((IFillSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                    //设置按钮背景色
                    this.btnColor.BackColor = color;
                }
                this.btnOutlineColor.BackColor =
                    this.ConvertIRgbColorToColor(((IFillSymbol)pStyleGalleryItem.Item).Outline.Color as IRgbColor);
                //设置外框线宽度初始值
                this.nudWidth.Value = (decimal)((IFillSymbol)this.pStyleGalleryItem.Item).Outline.Width;
                break;

            default:
                color = Color.Black;
                break;
            }
            //预览符号
            this.PreviewImage();
        }
Example #12
0
 //选择样式
 private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     //选择样式
     m_pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
     if (m_pStyleGalleryItem != null)
     {
         INorthArrow pNorthArrow = m_pStyleGalleryItem.Item as INorthArrow;
         NorthArrowAngle.Text      = pNorthArrow.Angle.ToString();
         this.NorthArrowSize.Value = pNorthArrow.Size;
         IColor pNorthArrowColor = pNorthArrow.Color;
         Color  pColor           = ColorTranslator.FromOle(pNorthArrowColor.RGB);
         colorNorthArrow.SelectedColor = pColor;
     }
     PreviewImage();
 }
Example #13
0
        //选择样式
        private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            //选择样式
            pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            if (pStyleGalleryItem != null)
            {
                pTextSymbol = pStyleGalleryItem.Item as ITextSymbol;
                IColor pTextColor = pTextSymbol.Color;
                Color  pColor     = ColorTranslator.FromOle(pTextColor.RGB);
                FontColor.SelectedColor = pColor;

                cmbBoxFontName.Text = pTextSymbol.Font.Name;
                FontSize.Text       = pTextSymbol.Font.Size.ToString();
            }
            PreviewImage();
        }
Example #14
0
        //选择边框样式
        private void axSymbologyCtlFram_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            //选择样式
            pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;

            if (pStyleGalleryItem != null)
            {
                SymbolBorder = (ISymbolBorder)pStyleGalleryItem.Item;
                ILineSymbol PLS = SymbolBorder.LineSymbol;
                this.SizeBorder.Text = PLS.Width.ToString();
                IColor pLineColor = PLS.Color;
                Color  pColor     = ColorTranslator.FromOle(pLineColor.RGB);
                colorBorder.SelectedColor = pColor;
                pLineSymbol = null;
            }
            PreviewImage();
        }
Example #15
0
        //样式选择
        private void axSymbologyCtlFrame_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            //选择样式
            pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            if (pStyleGalleryItem != null)
            {
                SymbolBackground = pStyleGalleryItem.Item as ISymbolBackground;
                IFillSymbol pFS = SymbolBackground.FillSymbol;
                this.SizeBackgroundOutline.Text = pFS.Outline.Width.ToString();

                IColor pFillColor = pFS.Color;
                Color  pColorFill = ColorTranslator.FromOle(pFillColor.RGB);
                colorFill.SelectedColor = pColorFill;

                IColor pOutlineColor = pFS.Outline.Color;
                Color  pColorOutline = ColorTranslator.FromOle(pOutlineColor.RGB);
                colorOutline.SelectedColor = pColorOutline;
            }
            PreviewImage();
        }
Example #16
0
        /// <summary>
        /// 选中符号时触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            _pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            Color color;

            switch (this.axSymbologyControl1.StyleClass)
            {
            //点符号
            case esriSymbologyStyleClass.esriStyleClassMarkerSymbols:
                color = this.ConvertIRgbColorToColor(((IMarkerSymbol)_pStyleGalleryItem.Item).Color as IRgbColor);
                //设置点符号角度和大小初始值
                this.nudAngle.Value = (decimal)((IMarkerSymbol)this._pStyleGalleryItem.Item).Angle;
                this.nudSize.Value  = (decimal)((IMarkerSymbol)this._pStyleGalleryItem.Item).Size;
                break;

            //线符号
            case esriSymbologyStyleClass.esriStyleClassLineSymbols:
                color = this.ConvertIRgbColorToColor(((ILineSymbol)_pStyleGalleryItem.Item).Color as IRgbColor);
                //设置线宽初始值
                this.nudWidth.Value = (decimal)((ILineSymbol)this._pStyleGalleryItem.Item).Width;
                break;

            //面符号
            case esriSymbologyStyleClass.esriStyleClassFillSymbols:
                color = this.ConvertIRgbColorToColor(((IFillSymbol)_pStyleGalleryItem.Item).Color as IRgbColor);
                ILineSymbol outline = ((IFillSymbol)_pStyleGalleryItem.Item).Outline;
                this.btnOutlineColor.Color = this.ConvertIRgbColorToColor(outline.Color as IRgbColor);
                this.nudWidth.Value        = (decimal)outline.Width;//设置外框线宽度初始值
                break;

            default:
                color = Color.Black;
                break;
            }
            //设置按钮背景色
            this.btnColor.Color = color;
            //预览符号
            this.PreviewImage();
        }
Example #17
0
        private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            button2.Enabled     = true;
            m_pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            if (m_pStyleGalleryItem == null)
            {
                return;
            }
            //获取新的指北针
            pMarkerNorthArrow = m_pStyleGalleryItem.Item as IMarkerNorthArrow;
            if (pMarkerNorthArrow == null)
            {
                return;
            }
            pCharacterMarkerSymbol      = pMarkerNorthArrow.MarkerSymbol as ICharacterMarkerSymbol;
            pCharacterMarkerSymbol.Size = 100;
            System.Drawing.Image image = PageLayoutInsert.CreatePictureFromSymbol((ISymbol)this.pCharacterMarkerSymbol, this.picBoxPreview.Width, this.picBoxPreview.Height, 0);
            this.picBoxPreview.Image = image;

            textBoxSize.Text  = pCharacterMarkerSymbol.Size.ToString();
            textBoxAngle.Text = pCharacterMarkerSymbol.Angle.ToString();
        }
Example #18
0
        private void SymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            pStyleGalleryItem = e.styleGalleryItem as IStyleGalleryItem;
            Color color;

            try
            {
                switch (SymbologyControl.StyleClass)
                {
                case esriSymbologyStyleClass.esriStyleClassMarkerSymbols:
                    color = this.ConvertIRgbColorToColor(((IMarkerSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                    this.nudAngle.Value = (decimal)((IMarkerSymbol)this.pStyleGalleryItem.Item).Angle;
                    this.nudSize.Value  = (decimal)((IMarkerSymbol)this.pStyleGalleryItem.Item).Size;
                    break;

                case esriSymbologyStyleClass.esriStyleClassLineSymbols:
                    color = this.ConvertIRgbColorToColor(((ILineSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                    this.nudWidth.Value = (decimal)((ILineSymbol)this.pStyleGalleryItem.Item).Width;
                    break;

                case esriSymbologyStyleClass.esriStyleClassFillSymbols:
                    color = this.ConvertIRgbColorToColor(((IFillSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                    btnOutlineColor.BackColor = this.ConvertIRgbColorToColor(((IFillSymbol)pStyleGalleryItem.Item).Outline.Color as IRgbColor);
                    this.nudWidth.Value       = (decimal)((IFillSymbol)this.pStyleGalleryItem.Item).Outline.Width;
                    break;

                default:
                    color = Color.Black;
                    break;
                }
                this.btnColor.BackColor = color;
                this.PreviewImage();
            }
            catch (Exception err)
            {
                //MessageBoxEx.Show(err.ToString());解决NULL问题
            }
        }
 private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     this.pStyleGalleryItem = e.styleGalleryItem as IStyleGalleryItem;
     this.PreviewImage();
 }
 private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     this.pStyleGalleryItem = e.styleGalleryItem as IStyleGalleryItem;
     this.PreviewImage();
 }
Example #21
0
 /// <summary>
 /// Axes the symbology control1_ on item selected.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     this._styleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
     this.Init();
 }
Example #22
0
        /// <summary>
        /// 选中已有项目时触发事件
        /// </summary>
        /// <param name="sender">符号选择控件</param>
        /// <param name="e">axSymbologyControl选择事件参数</param>
        private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            SwitchItemForOutLine   = true;
            OriginStyleGalleryItem = e.styleGalleryItem as IStyleGalleryItem;
            IObjectCopy pObjectCopy = new ObjectCopyClass();

            switch (CurrentSymbologyStyleClass)
            {
            case esriSymbologyStyleClass.esriStyleClassMarkerSymbols:
                currentStyleGalleryItem = pObjectCopy.Copy(OriginStyleGalleryItem) as IStyleGalleryItem;
                pMarkerSymbol           = currentStyleGalleryItem.Item as IMarkerSymbol;
                byte[] myMarkerByte = LongToRGB(pMarkerSymbol.Color.RGB);
                colMarkerSymbolsColor.Color     = System.Drawing.Color.FromArgb(myMarkerByte[0], myMarkerByte[1], myMarkerByte[2]);
                spnMarkerSymbolsSize.EditValue  = pMarkerSymbol.Size;
                spnMarkerSymbolsAngle.EditValue = pMarkerSymbol.Angle;
                break;

            case esriSymbologyStyleClass.esriStyleClassLineSymbols:
                currentStyleGalleryItem = pObjectCopy.Copy(OriginStyleGalleryItem) as IStyleGalleryItem;
                pLineSymbol             = currentStyleGalleryItem.Item as ILineSymbol;
                byte[] myLineByte = LongToRGB(pLineSymbol.Color.RGB);
                colLineSymbolsColor.Color     = System.Drawing.Color.FromArgb(myLineByte[0], myLineByte[1], myLineByte[2]);
                spnLineSymbolsWidth.EditValue = pLineSymbol.Width;
                break;

            case esriSymbologyStyleClass.esriStyleClassFillSymbols:
                currentStyleGalleryItem = pObjectCopy.Copy(OriginStyleGalleryItem) as IStyleGalleryItem;
                IFillSymbol pTempFillSymbol = OriginStyleGalleryItem.Item as IFillSymbol;
                pOriginOutlineSymbol = pTempFillSymbol.Outline;
                pFillSymbol          = currentStyleGalleryItem.Item as IFillSymbol;
                try
                {
                    byte[] myFillByte = LongToRGB(pFillSymbol.Color.RGB);
                    colFillSymbolsFillColor.Color = System.Drawing.Color.FromArgb(myFillByte[0], myFillByte[1], myFillByte[2]);
                }
                catch
                {
                    colFillSymbolsFillColor.Color   = System.Drawing.Color.FromArgb(0);
                    colFillSymbolsFillColor.Enabled = false;
                }
                spnFillSymbolsLineWidth.EditValue = pFillSymbol.Outline.Width;
                try
                {
                    byte[] myOutLineByte = LongToRGB(pFillSymbol.Outline.Color.RGB);
                    colFillSymbolsLineColor.Color = System.Drawing.Color.FromArgb(myOutLineByte[0], myOutLineByte[1], myOutLineByte[2]);
                }
                catch
                {
                    colFillSymbolsLineColor.Color   = System.Drawing.Color.FromArgb(0);
                    colFillSymbolsLineColor.Enabled = false;
                }
                break;

//				case esriSymbologyStyleClass.esriStyleClassLabels:
            case esriSymbologyStyleClass.esriStyleClassTextSymbols:
                ITextSymbol pTempTextSymbol = currentStyleGalleryItem.Item as ITextSymbol;
                string      strText         = pTempTextSymbol.Text;
                currentStyleGalleryItem         = pObjectCopy.Copy(OriginStyleGalleryItem) as IStyleGalleryItem;
                pTextSymbol                     = currentStyleGalleryItem.Item as ITextSymbol;
                pTextSymbol.Text                = strText;
                currentStyleGalleryItem.Item    = pTextSymbol;
                pTextSymbol.HorizontalAlignment = esriTextHorizontalAlignment.esriTHACenter;
                pTextSymbol.VerticalAlignment   = esriTextVerticalAlignment.esriTVACenter;
                byte[] byteColor = LongToRGB(pTextSymbol.Color.RGB);
                colTextSymbolsColor.Color           = System.Drawing.Color.FromArgb(byteColor[0], byteColor[1], byteColor[2]);
                comTextSymbolsFont.Text             = pTextSymbol.Font.Name;            //当前选择中的字体名
                comTextSymbolsFontSize.Text         = pTextSymbol.Font.Size.ToString(); //当前选择中字体大小
                btnTextSymbolsBoldFont.Checked      = pTextSymbol.Font.Bold;
                btnTextSymbolsItalicFont.Checked    = pTextSymbol.Font.Italic;
                btnTextSymbolsUnderlineFont.Checked = pTextSymbol.Font.Underline;
                btnTextSymbolsStrikethrough.Checked = pTextSymbol.Font.Strikethrough;
                ICharacterOrientation pCharacterOrientation = pTextSymbol as ICharacterOrientation;
                chkTextSymbolsCJK.Checked = pCharacterOrientation.CJKCharactersRotation;
                break;
            }
            PreviewImage();
            SwitchItemForOutLine = false;
        }
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     m_StyleGallertItem = (IStyleGalleryItem)e.styleGalleryItem;
 }
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     //Get the selected item
     m_styleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
 }
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
     this.PreviewImage();
     // i = pStyleGalleryItem.ID;
 }
Example #26
0
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
     this.PreviewImage();
      // i = pStyleGalleryItem.ID;
 }
Example #27
0
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     m_styleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
     PreviewImage();
 }
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     //Get the selected item
     m_styleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
 }
        private void axSymbologyControl_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
        {
            pStyleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
            Color color;
            switch (this.axSymbologyControl.StyleClass)
            {
                //点符号
                case esriSymbologyStyleClass.esriStyleClassMarkerSymbols:
                    color = this.ConvertIRgbColorToColor(((IMarkerSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                    //设置点符号角度和大小初始值
                    this.nudAngle.Value = (decimal)((IMarkerSymbol)this.pStyleGalleryItem.Item).Angle;
                    this.nudSize.Value = (decimal)((IMarkerSymbol)this.pStyleGalleryItem.Item).Size;
                    break;

                //线符号
                case esriSymbologyStyleClass.esriStyleClassLineSymbols:
                    color = this.ConvertIRgbColorToColor(((ILineSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                    //设置线宽初始值
                    this.nudWidth.Value = (decimal)((ILineSymbol)this.pStyleGalleryItem.Item).Width;
                    break;

                //面符号
                case esriSymbologyStyleClass.esriStyleClassFillSymbols:
                    color = this.ConvertIRgbColorToColor(((IFillSymbol)pStyleGalleryItem.Item).Color as IRgbColor);
                    this.btnOutlineColor.BackColor = this.ConvertIRgbColorToColor(((IFillSymbol)pStyleGalleryItem.Item).Outline.Color as IRgbColor);
                    //设置外框线宽度初始值
                    this.nudWidth.Value = (decimal)((IFillSymbol)this.pStyleGalleryItem.Item).Outline.Width;
                    break;

                default:
                    color = Color.Black;
                    break;
            }
            //设置按钮背景色
            this.btnColor.BackColor = color;
            //预览符号
            this.PreviewImage();
        }
 //axSymbologyControl空间SymbolItem选中事件相应函数
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     pStyleGalleryItem = e.styleGalleryItem as IStyleGalleryItem;  //获取选择项
     PreviewPicture();  //在图片框中显示
     //点,将属性传递到调节的控件上
     if (((IFeatureLayer)pLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)  
     {
         IRgbColor pColor = ((IMarkerSymbol)pStyleGalleryItem.Item).Color as IRgbColor;
         //btColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);      //颜色
         nudAngle.Value = Convert.ToDecimal(((IMarkerSymbol)pStyleGalleryItem.Item).Angle);  //角度
         nudWidth.Value = Convert.ToDecimal(((IMarkerSymbol)pStyleGalleryItem.Item).Size);   //大小
     }
     //线
     if (((IFeatureLayer)pLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline)
     {
         IRgbColor pColor = ((ILineSymbol)pStyleGalleryItem.Item).Color as IRgbColor;
         //btColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);      //颜色
         nudWidth.Value = Convert.ToDecimal(((ILineSymbol)pStyleGalleryItem.Item).Width);    //宽度
     }
     //面
     if (((IFeatureLayer)pLayer).FeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
     {
         IRgbColor pColor = ((IFillSymbol)pStyleGalleryItem.Item).Color as IRgbColor;
         //btColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);      //填充色
         cbColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);      //填充色
         nudWidth.Value = Convert.ToDecimal(((IFillSymbol)pStyleGalleryItem.Item).Outline.Width);    //边框宽度
         pColor = ((IFillSymbol)pStyleGalleryItem.Item).Outline.Color as IRgbColor;
         //btOutlineColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);   //边框颜色
         cbOutlineColor.BackColor = Color.FromArgb(pColor.Red, pColor.Green, pColor.Blue);   //边框颜色
     }
 }
Example #31
0
 private void axSymbologyControl1_OnItemSelected(object sender, ISymbologyControlEvents_OnItemSelectedEvent e)
 {
     m_styleGalleryItem = (IStyleGalleryItem)e.styleGalleryItem;
     PreviewColorSet();
 }