Beispiel #1
0
 private void chkStrike_Click(object sender, EventArgs e)
 {
     stdole.IFontDisp font = this.m_pTextSymbol.Font;
     font.Strikethrough      = this.chkStrike.Checked;
     this.m_pTextSymbol.Font = font;
     this.refresh(e);
 }
Beispiel #2
0
 private void chkUnderline_Click(object sender, EventArgs e)
 {
     stdole.IFontDisp font = this.m_pTextSymbol.Font;
     font.Underline          = this.chkUnderline.Checked;
     this.m_pTextSymbol.Font = font;
     this.refresh(e);
 }
Beispiel #3
0
 private void InitControl()
 {
     this.m_CanDo = false;
     if (this.m_pTextSymbol == null)
     {
         this.m_pTextSymbol = new TextSymbolClass();
     }
     this.SetColorEdit(this.colorEdit1, this.m_pTextSymbol.Color);
     this.numUpDownSize.Value          = (decimal)this.m_pTextSymbol.Size;
     this.spinEditXOffset.Value        = (decimal)((this.m_pTextSymbol as ISimpleTextSymbol).XOffset * this.m_unit);
     this.spinEditYOffset.Value        = (decimal)((this.m_pTextSymbol as ISimpleTextSymbol).YOffset * this.m_unit);
     this.spinEditAngle.Value          = (decimal)(this.m_pTextSymbol as ISimpleTextSymbol).Angle;
     this.radioGroupHor.SelectedIndex  = (int)this.m_pTextSymbol.HorizontalAlignment;
     this.radioGroupVert.SelectedIndex = (int)this.m_pTextSymbol.VerticalAlignment;
     this.chkVert.Checked = (this.m_pTextSymbol as ICharacterOrientation).CJKCharactersRotation;
     stdole.IFontDisp font = this.m_pTextSymbol.Font;
     this.chkBold.Checked      = font.Bold;
     this.chkItalic.Checked    = font.Italic;
     this.chkUnderline.Checked = font.Underline;
     this.chkStrike.Checked    = font.Strikethrough;
     for (int i = 0; i < this.cboFontName.Properties.Items.Count; i++)
     {
         if (this.m_pTextSymbol.Font.Name == this.cboFontName.Properties.Items[i].ToString())
         {
             this.cboFontName.SelectedIndex = i;
             break;
         }
     }
     this.m_CanDo = true;
 }
        /// <summary>
        /// 根据当前IStyleGalleryItem的值来更新属性控件状态
        /// </summary>
        private void ChangeControlsByItem()
        {
            //更新单位控件的值
            int unitIndex = GetUnitIndexFromItem(m_styleGalleryItem.Item);

            cmbxUnit.DataSource    = System.Enum.GetNames(typeof(UnitsType));
            cmbxUnit.SelectedIndex = unitIndex;
            //更新文本字体控件的值
            stdole.IFontDisp textFont = GetTextFontFromItem(m_styleGalleryItem.Item);
            cmbxTextFont.DataSource    = System.Enum.GetNames(typeof(FontType));
            cmbxTextFont.SelectedIndex = cmbxTextFont.FindString(textFont.Name);

            //更新文本大小控件的值
            this.cmbxTextSize.DataSource = _sizeFontArr;
            this.cmbxTextSize.Text       = GetTextSizeFromItem(m_styleGalleryItem.Item).ToString();
            //更新文本颜色控件的值
            btnTextColor.BackColor = GetTextColorFromItem(m_styleGalleryItem.Item);


            //更新条块大小控件的值
            this.cmbxSymbolSize.DataSource = _sizeBarArr;
            this.cmbxSymbolSize.Text       = GetTextSizeFromItem(m_styleGalleryItem.Item).ToString();
            //更新条块颜色控件的值
            btnSymbolColor.BackColor = GetSymbolColorFromItem(m_styleGalleryItem.Item);
        }
Beispiel #5
0
 public void Apply()
 {
     if (this.m_IsPageDirty)
     {
         this.m_IsPageDirty = false;
         stdole.IFontDisp secondaryFont = this.m_pMixedFormatGridLabel.SecondaryFont;
         if (this.cboFontName.SelectedIndex != -1)
         {
             secondaryFont.Name = this.cboFontName.Text;
         }
         secondaryFont.Bold      = this.chkBold.Checked;
         secondaryFont.Italic    = this.chkIta.Checked;
         secondaryFont.Underline = this.chkUnderLine.Checked;
         this.m_pMixedFormatGridLabel.SecondaryFont = secondaryFont;
         IColor secondaryColor = this.m_pMixedFormatGridLabel.SecondaryColor;
         this.UpdateColorFromColorEdit(this.colorEdit1, secondaryColor);
         this.m_pMixedFormatGridLabel.SecondaryColor    = secondaryColor;
         this.m_pMixedFormatGridLabel.SecondaryFontSize = double.Parse(this.cboFontSize.Text);
         if (this.radioGroup.SelectedIndex == 0)
         {
             this.m_pMixedFormatGridLabel.NumGroupedDigits = 0;
         }
         else
         {
             this.m_pMixedFormatGridLabel.NumGroupedDigits = (short)this.txtNumGroupedDigits.Value;
         }
     }
 }
Beispiel #6
0
        //CharacterMarkerSymbol
        private void button3_Click(object sender, EventArgs e)
        {
            ICharacterMarkerSymbol characterMarkerSymbol = new CharacterMarkerSymbol();

            stdole.IFontDisp fontDisp = (stdole.IFontDisp)(new stdole.StdFontClass());
            IRgbColor        rgbColor = new RgbColor();

            rgbColor        = getRGB(100, 100, 100);
            fontDisp.Name   = "arial";
            fontDisp.Size   = 12;
            fontDisp.Italic = true;

            characterMarkerSymbol.Angle          = 0;
            characterMarkerSymbol.CharacterIndex = 97;
            characterMarkerSymbol.Color          = rgbColor;
            characterMarkerSymbol.Font           = fontDisp;
            characterMarkerSymbol.Size           = 24;
            characterMarkerSymbol.XOffset        = 0;
            characterMarkerSymbol.YOffset        = 0;

            IPoint point1 = new PointClass();
            IPoint point2 = new PointClass();

            point1.PutCoords(5, 5);
            point2.PutCoords(5, 10);
            this.axMapControl1.FlashShape(point1 as IGeometry, 3, 500, characterMarkerSymbol);
            this.axMapControl1.FlashShape(point2 as IGeometry);
        }
        private void DrawColName()
        {
            IGraphicsContainer pGraContainer = m_pMapControl.Map as IGraphicsContainer;
            ITextElement       pTextElement;
            IElement           pElement;
            IPoint             pAnnoPnt = new PointClass();
            ITextSymbol        sym      = new TextSymbolClass();

            stdole.IFontDisp myfont = (stdole.IFontDisp) new stdole.StdFontClass();
            myfont.Name = "华文细黑";
            sym.Font    = myfont;

            myfont.Bold = true;
            sym.Size    = 8;//SystemInfo.Instance.TextSize;

            Color  color  = ColorTranslator.FromHtml(SystemInfo.Instance.TextColor);
            IColor pColor = new RgbColorClass();

            pColor.RGB = color.B * 65536 + color.G * 256 + color.R;
            sym.Color  = pColor;

            for (int i = 0; i < m_pArrText.Count; i++)
            {
                sym.Text = m_pArrText[i].ToString();
                pAnnoPnt.PutCoords(dblStartX + nWidth * m_pArrPipes.Count, dblStartY + nHeight * (m_pArrText.Count - i));
                pTextElement           = new TextElementClass();
                pTextElement.ScaleText = true;
                pTextElement.Text      = sym.Text;
                pTextElement.Symbol    = sym;
                pElement          = (IElement)pTextElement;
                pElement.Geometry = pAnnoPnt;
                pGraContainer.AddElement(pElement, 0);
                (m_pMapControl.Map as IActiveView).PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, m_pMapControl.Extent);
            }
        }
Beispiel #8
0
        private void method_0()
        {
            if (this.itextElement_0 != null)
            {
                this.txtString.Text = this.itextElement_0.Text;
                stdole.IFontDisp font = this.itextElement_0.Symbol.Font;
                this.txtFontInfo.Text = font.Name + " " + font.Size.ToString();
                this.esriTextHorizontalAlignment_0 =
                    (this.itextElement_0 as ISymbolCollectionElement).HorizontalAlignment;
                this.txtCharacterSpace.Text =
                    (this.itextElement_0 as ISymbolCollectionElement).CharacterSpacing.ToString();
                this.txtLeading.Text = (this.itextElement_0 as ISymbolCollectionElement).Leading.ToString("0.##");
                this.double_0        = this.itextSymbol_0.Angle;
                this.txtAngle.Text   = this.double_0.ToString("0.###");
                switch (this.esriTextHorizontalAlignment_0)
                {
                case esriTextHorizontalAlignment.esriTHALeft:
                    this.rdoTHALeft.Checked = true;
                    break;

                case esriTextHorizontalAlignment.esriTHACenter:
                    this.rdoTHACenter.Checked = true;
                    break;

                case esriTextHorizontalAlignment.esriTHARight:
                    this.rdoTHARight.Checked = true;
                    break;

                case esriTextHorizontalAlignment.esriTHAFull:
                    this.rdoTHAFul.Checked = true;
                    break;
                }
            }
        }
 public void Apply()
 {
     if (this.m_IsPageDirty)
     {
         this.m_IsPageDirty = false;
         stdole.IFontDisp smallLabelFont = this.m_GridLable.SmallLabelFont;
         if (this.cboFontName.SelectedIndex != -1)
         {
             smallLabelFont.Name = this.cboFontName.Text;
         }
         smallLabelFont.Size             = (decimal)double.Parse(this.cboFontSize.Text);
         smallLabelFont.Bold             = this.chkBold.Checked;
         smallLabelFont.Italic           = this.chkIta.Checked;
         smallLabelFont.Underline        = this.chkUnderLine.Checked;
         this.m_GridLable.SmallLabelFont = smallLabelFont;
         IColor smallLabelColor = this.m_GridLable.SmallLabelColor;
         this.UpdateColorFromColorEdit(this.colorEdit1, smallLabelColor);
         this.m_GridLable.SmallLabelColor     = smallLabelColor;
         this.m_GridLable.BaseDigitCount      = (int)this.txtBaseDigitCount.Value;
         this.m_GridLable.PrincipalDigitCount = (int)this.txtPrincipalDigitCount.Value;
         this.m_GridLable.UnitSuffix          = this.txtUnitSuffix.Text;
         this.m_GridLable.NorthingSuffix      = this.txtNorthingSuffix.Text;
         this.m_GridLable.EastingSuffix       = this.txtEastingSuffix.Text;
     }
 }
Beispiel #10
0
 private void btnUnderline_Click(object sender, EventArgs e)
 {
     stdole.IFontDisp font = this.itextSymbol_0.Font;
     font.Underline                    = true;
     this.itextSymbol_0.Font           = font;
     this.ilegend_0.Format.TitleSymbol = this.itextSymbol_0;
 }
 public void Apply()
 {
     if (this.m_IsPageDirty)
     {
         this.m_IsPageDirty = false;
         GridAxisPropertyPage.m_pMapGrid.SetLabelVisibility(this.chkLabelLeft.Checked, this.chkLabelTop.Checked,
                                                            this.chkLabelRight.Checked, this.chkLabelBottom.Checked);
         this.pGridLabel.set_LabelAlignment(esriGridAxisEnum.esriGridAxisBottom, !this.chkverticalBottom.Checked);
         this.pGridLabel.set_LabelAlignment(esriGridAxisEnum.esriGridAxisLeft, !this.chkverticalLeft.Checked);
         this.pGridLabel.set_LabelAlignment(esriGridAxisEnum.esriGridAxisRight, !this.chkverticalRight.Checked);
         this.pGridLabel.set_LabelAlignment(esriGridAxisEnum.esriGridAxisTop, !this.chkverticalTop.Checked);
         stdole.IFontDisp font = this.pGridLabel.Font;
         if (this.cboFontName.SelectedIndex != -1)
         {
             font.Name = this.cboFontName.Text;
         }
         font.Size            = (decimal)double.Parse(this.cboFontSize.Text);
         font.Bold            = this.chkBold.Checked;
         font.Italic          = this.chkIta.Checked;
         font.Underline       = this.chkUnderLine.Checked;
         this.pGridLabel.Font = font;
         IColor pColor = this.pGridLabel.Color;
         this.UpdateColorFromColorEdit(this.colorEdit1, pColor);
         this.pGridLabel.Color       = pColor;
         this.pGridLabel.LabelOffset = (double)this.txtLabelOffset.Value;
         GridAxisPropertyPage.m_pMapGrid.LabelFormat = this.pGridLabel;
     }
 }
Beispiel #12
0
        private void DrawText(string property, int i)
        {
            IGraphicsContainer pGraContainer = m_pMapControl.Map as IGraphicsContainer;
            ITextElement       pTextElement;
            IElement           pElement;
            IPoint             pAnnoPnt = new PointClass();
            ITextSymbol        sym      = new TextSymbolClass();

            stdole.IFontDisp myfont = (stdole.IFontDisp) new stdole.StdFontClass();
            myfont.Name = "华文细黑";
            sym.Font    = myfont;

            myfont.Bold = true;
            sym.Size    = 8;//SystemInfo.Instance.TextSize;

            Color  color  = ColorTranslator.FromHtml(SystemInfo.Instance.TextColor);
            IColor pColor = new RgbColorClass();

            pColor.RGB = color.B * 65536 + color.G * 256 + color.R;
            sym.Color  = pColor;

            sym.Text = property;
            pAnnoPnt.PutCoords(dblStartX + nWidth * m_LabelPoints.Count + 8, dblStartY + nHeight * (fields.Length - i));//居中显示,并位于表格边线以上m_dblTableHeadWidth/5*3
            pTextElement           = new TextElementClass();
            pTextElement.ScaleText = true;
            pTextElement.Text      = sym.Text;
            pTextElement.Symbol    = sym;
            pElement          = (IElement)pTextElement;
            pElement.Geometry = pAnnoPnt;
            pGraContainer.AddElement(pElement, 0);
        }
 public void Apply()
 {
     if (this.bool_1)
     {
         this.bool_1 = false;
         this.m_pMapGrid.SetLabelVisibility(this.chkLabelLeft.Checked, this.chkLabelTop.Checked,
                                            this.chkLabelRight.Checked, this.chkLabelBottom.Checked);
         this.igridLabel_0.set_LabelAlignment(esriGridAxisEnum.esriGridAxisBottom,
                                              !this.chkverticalBottom.Checked);
         this.igridLabel_0.set_LabelAlignment(esriGridAxisEnum.esriGridAxisLeft, !this.chkverticalLeft.Checked);
         this.igridLabel_0.set_LabelAlignment(esriGridAxisEnum.esriGridAxisRight, !this.chkverticalRight.Checked);
         this.igridLabel_0.set_LabelAlignment(esriGridAxisEnum.esriGridAxisTop, !this.chkverticalTop.Checked);
         stdole.IFontDisp font = this.igridLabel_0.Font;
         if (this.cboFontName.SelectedIndex != -1)
         {
             font.Name = this.cboFontName.Text;
         }
         font.Size              = (decimal)double.Parse(this.cboFontSize.Text);
         font.Bold              = this.chkBold.Checked;
         font.Italic            = this.chkIta.Checked;
         font.Underline         = this.chkUnderLine.Checked;
         this.igridLabel_0.Font = font;
         IColor color = this.igridLabel_0.Color;
         this.method_3(this.colorEdit1, color);
         this.igridLabel_0.Color       = color;
         this.igridLabel_0.LabelOffset = (double)this.txtLabelOffset.Value;
         this.m_pMapGrid.LabelFormat   = this.igridLabel_0;
     }
 }
Beispiel #14
0
        public static stdole.IFontDisp GetFontDisp(string fontName, float fontSize)
        {
            stdole.IFontDisp fdisp = null;
            Font             f     = new Font(fontName, fontSize);

            fdisp = ESRI.ArcGIS.ADF.COMSupport.OLE.GetIFontDispFromFont(f) as stdole.IFontDisp;
            return(fdisp);
        }
Beispiel #15
0
 /// <summary>
 /// Handles the EditValueChanged event of the cmbTxtFont control.
 /// </summary>
 /// <param name="obj">The source of the event.</param>
 /// <param name="eventArgs">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void cmbTxtFont_EditValueChanged(object obj, EventArgs eventArgs)
 {
     this._txtSymble = (this._styleGalleryItem.Item as ITextSymbol);
     stdole.IFontDisp font = this._txtSymble.Font;
     font.Name            = this.cmbTxtFont.EditValue.ToString();
     this._txtSymble.Font = font;
     this.ViewSymble();
 }
Beispiel #16
0
 public void Apply()
 {
     if (this.m_IsPageDirty)
     {
         this.m_IsPageDirty = false;
         IGridLadderLabels pMapGrid        = GridAxisPropertyPage.m_pMapGrid as IGridLadderLabels;
         stdole.IFontDisp  ladderLabelFont = pMapGrid.LadderLabelFont;
         if (this.cboFontName.SelectedIndex != -1)
         {
             ladderLabelFont.Name = this.cboFontName.Text;
         }
         ladderLabelFont.Bold      = this.chkBold.Checked;
         ladderLabelFont.Italic    = this.chkIta.Checked;
         ladderLabelFont.Underline = this.chkUnderLine.Checked;
         pMapGrid.LadderLabelFont  = ladderLabelFont;
         try
         {
             pMapGrid.LadderLabelSize = double.Parse(this.cboFontSize.Text);
         }
         catch
         {
         }
         IColor ladderLabelColor = pMapGrid.LadderLabelColor;
         this.UpdateColorFromColorEdit(this.colorEdit1, ladderLabelColor);
         pMapGrid.LadderLabelColor       = ladderLabelColor;
         pMapGrid.LadderLabelColumnCount = (int)this.txtColumnCount.Value;
         pMapGrid.LadderLabelRowCount    = (int)this.txtRowCount.Value;
         pMapGrid.ShowLadderLabels       = this.chkShowLadderLabels.Checked;
         pMapGrid.ShowOuterLabelsOnly    = this.chkShowOuterLabelsOnly.Checked;
         IMgrsGrid grid = GridAxisPropertyPage.m_pMapGrid as IMgrsGrid;
         ladderLabelFont = grid.GridSquareLabelFont;
         if (this.cboGSLFontName.SelectedIndex != -1)
         {
             ladderLabelFont.Name = this.cboGSLFontName.Text;
         }
         ladderLabelFont.Bold      = this.chkBold_GSL.Checked;
         ladderLabelFont.Italic    = this.chkIta_GSL.Checked;
         ladderLabelFont.Underline = this.chkUnderLine_GSL.Checked;
         grid.GridSquareLabelFont  = ladderLabelFont;
         try
         {
             grid.GridSquareLabelSize = double.Parse(this.cboGSLFontsize.Text);
         }
         catch
         {
         }
         ladderLabelColor = grid.GridSquareLabelColor;
         this.UpdateColorFromColorEdit(this.colorEdit2, ladderLabelColor);
         grid.GridSquareLabelColor      = ladderLabelColor;
         grid.ShowGridSquareIdentifiers = this.chkShowGSIdentifiers.Checked;
         grid.GridSquareBoundarySymbol  = this.btnBorder.Style as ILineSymbol;
         grid.GridSquareLabelStyle      = (esriGridSquareLabelStyleEnum)this.cboGSLStyle.SelectedIndex;
         grid.InteriorTickSymbol        = this.btnTickSymbol.Style as ILineSymbol;
         grid.InteriorTickLength        = (double)this.txtTickLength.Value;
         this.m_CanDo = true;
     }
 }
Beispiel #17
0
 private void cboFontName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.bool_0)
     {
         stdole.IFontDisp font = this.itextSymbol_0.Font;
         font.Name = (string)this.cboFontName.Items[this.cboFontName.SelectedIndex];
         this.itextSymbol_0.Font           = font;
         this.ilegend_0.Format.TitleSymbol = this.itextSymbol_0;
     }
 }
 private void SetTextSymbol(ITextSymbol pTextSymbol)
 {
     this.SetColorEdit(this.colorTextSymbol, pTextSymbol.Color);
     stdole.IFontDisp font = pTextSymbol.Font;
     this.chkBold.Checked = font.Bold;
     this.chkItalic.Checked = font.Italic;
     this.chkUnderline.Checked = font.Underline;
     this.cboFontName.Text = font.Name;
     this.cboFontSize.Text = font.Size.ToString();
 }
Beispiel #19
0
 private void cboFontName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.m_CanDo)
     {
         stdole.IFontDisp font = this.m_pTextSymbol.Font;
         font.Name = (string)this.cboFontName.Properties.Items[this.cboFontName.SelectedIndex];
         this.m_pTextSymbol.Font = font;
         this.refresh(e);
     }
 }
Beispiel #20
0
        /// <summary>
        /// Handles the EditValueChanged event of the cmbTxtSize control.
        /// </summary>
        /// <param name="obj">The source of the event.</param>
        /// <param name="eventArgs">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void cmbTxtSize_EditValueChanged(object obj, EventArgs eventArgs)
        {
            decimal size = Convert.ToDecimal(this.cmbTxtSize.Value);

            this._txtSymble = (this._styleGalleryItem.Item as ITextSymbol);
            stdole.IFontDisp font = this._txtSymble.Font;
            font.Size            = size;
            this._txtSymble.Font = font;
            this.ViewSymble();
        }
 private void method_1(ITextSymbol itextSymbol_0)
 {
     this.method_3(this.colorTextSymbol, itextSymbol_0.Color);
     stdole.IFontDisp font = itextSymbol_0.Font;
     this.chkBold.Checked      = font.Bold;
     this.chkItalic.Checked    = font.Italic;
     this.chkUnderline.Checked = font.Underline;
     this.cboFontName.Text     = font.Name;
     this.cboFontSize.Text     = font.Size.ToString();
 }
        public static void InitLabel(IGeoFeatureLayer pGeoFeaturelayer, string sFieldName)  //重新标注整个图层
        {
            /*IAnnotateLayerPropertiesCollection作用于一个要素图层的所有注记设置的集合,控制要素图层的一系列注记对象*/
            IAnnotateLayerPropertiesCollection pAnnoLayerPropsCollection;

            //定义标注类
            pAnnoLayerPropsCollection = pGeoFeaturelayer.AnnotationProperties;
            /*将要素图层注记集合中的所有项都移除*/
            pAnnoLayerPropsCollection.Clear();

            IBasicOverposterLayerProperties pBasicOverposterlayerProps = new BasicOverposterLayerPropertiesClass();

            switch (pGeoFeaturelayer.FeatureClass.ShapeType)
            {
            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolygon:
                pBasicOverposterlayerProps.FeatureType = esriBasicOverposterFeatureType.esriOverposterPolygon;
                break;

            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint:
                pBasicOverposterlayerProps.FeatureType = esriBasicOverposterFeatureType.esriOverposterPoint;
                break;

            case ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline:
                pBasicOverposterlayerProps.FeatureType = esriBasicOverposterFeatureType.esriOverposterPolyline;
                break;
            }
            ITextSymbol pTextSymbol = new TextSymbolClass();

            stdole.IFontDisp pFont = (stdole.IFontDisp) new stdole.StdFont();
            IRgbColor        pRGB  = null;

            pFont.Name       = "Arial";
            pFont.Size       = 9;
            pFont.Bold       = false;
            pFont.Italic     = false;
            pFont.Underline  = false;
            pTextSymbol.Font = pFont;
            if (pRGB == null)
            {
                pRGB              = new RgbColorClass();
                pRGB.Red          = 0;
                pRGB.Green        = 0;
                pRGB.Blue         = 0;
                pTextSymbol.Color = (IColor)pRGB;
            }

            ILabelEngineLayerProperties pLabelEnginelayerProps = new LabelEngineLayerPropertiesClass();

            pLabelEnginelayerProps.Expression = "[" + sFieldName + "]";
            pLabelEnginelayerProps.Symbol     = pTextSymbol;
            pLabelEnginelayerProps.BasicOverposterLayerProperties = pBasicOverposterlayerProps;
            /*将一项标注属性(LayerEngineLayerProperties对象)增加到要素图层的注记集合当中*/
            /*IAnnotateLayerProperties接口用于获取和修改要素图层注记类的注记属性,定义要素图层动态注记(文本)的显示*/
            pAnnoLayerPropsCollection.Add((IAnnotateLayerProperties)pLabelEnginelayerProps);
        }
Beispiel #23
0
 private void cboFontName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.listBoxControl1.SelectedIndex != -1)
     {
         SymbolIdentifierWrap selectedItem = this.listBoxControl1.SelectedItem as SymbolIdentifierWrap;
         stdole.IFontDisp     font         = (selectedItem.SymbolIdentifier.Symbol as ITextSymbol).Font;
         font.Name = this.cboFontName.Text;
         (selectedItem.SymbolIdentifier.Symbol as ITextSymbol).Font = font;
         this.method_5(selectedItem);
     }
 }
Beispiel #24
0
 private void chkUnderline_CheckedChanged(object sender, EventArgs e)
 {
     if (this.listBoxControl1.SelectedIndex != -1)
     {
         SymbolIdentifierWrap selectedItem = this.listBoxControl1.SelectedItem as SymbolIdentifierWrap;
         stdole.IFontDisp     font         = (selectedItem.SymbolIdentifier.Symbol as ITextSymbol).Font;
         font.Underline = this.chkUnderline.Checked;
         (selectedItem.SymbolIdentifier.Symbol as ITextSymbol).Font = font;
         this.method_5(selectedItem);
     }
 }
Beispiel #25
0
        private static ITextSymbol SetUpTextSymbol(System.Drawing.Font font, IRgbColor rgbColor)
        {
            ITextSymbol textSymbol = new TextSymbolClass();

            stdole.IFontDisp fontDisp = ESRI.ArcGIS.ADF.COMSupport.OLE.GetIFontDispFromFont(font) as stdole.IFontDisp;
            textSymbol.Font = fontDisp;
            textSymbol.HorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
            textSymbol.VerticalAlignment   = esriTextVerticalAlignment.esriTVABottom;
            textSymbol.Angle = 0;
            textSymbol.Color = rgbColor;
            return(textSymbol);
        }
Beispiel #26
0
        private void button1_Click(object sender, EventArgs e)
        {
            FontDialog fontDialog = new FontDialog();

            if (fontDialog.ShowDialog() == DialogResult.OK)
            {
                Font selectFont = fontDialog.Font;
                textBox2.Text = selectFont.Name + "  " + selectFont.Size.ToString();
                stdole.IFontDisp pFont = ESRI.ArcGIS.ADF.COMSupport.OLE.GetIFontDispFromFont(selectFont) as stdole.IFontDisp;
                pTextSymbol.Font = pFont;
            }
        }
Beispiel #27
0
 private void cboFontName_SelectedIndexChanged(object sender, EventArgs e)
 {
     System.Drawing.Font font =
         new System.Drawing.Font((string)this.cboFontName.Properties.Items[this.cboFontName.SelectedIndex], 10f);
     if (this.m_CanDo)
     {
         stdole.IFontDisp disp = this.m_pCharacterMarker3DSymbol.Font;
         disp.Name = (string)this.cboFontName.Properties.Items[this.cboFontName.SelectedIndex];
         this.m_pCharacterMarker3DSymbol.Font = disp;
         this.refresh(e);
     }
 }
Beispiel #28
0
        private void btnSymbolSelector_Click(object sender, EventArgs e)
        {
            try
            {
                frmSymbolSelector selector = new frmSymbolSelector();
                if (selector != null)
                {
                    selector.SetStyleGallery(this.istyleGallery_0);
                    selector.SetSymbol(this.itextSymbol_0);
                    if (selector.ShowDialog() == DialogResult.OK)
                    {
                        this.itextSymbol_0 = selector.GetSymbol() as ITextSymbol;
                        this.esriTextHorizontalAlignment_0 = this.itextSymbol_0.HorizontalAlignment;
                        stdole.IFontDisp font = this.itextElement_0.Symbol.Font;
                        this.txtFontInfo.Text    = font.Name + " " + font.Size.ToString();
                        this.double_0            = this.itextSymbol_0.Angle;
                        this.itextSymbol_0.Angle = 0.0;
                        this.bool_0                 = false;
                        this.txtAngle.Text          = this.double_0.ToString("0.###");
                        this.txtCharacterSpace.Text =
                            (this.itextSymbol_0 as IFormattedTextSymbol).CharacterSpacing.ToString();
                        this.txtLeading.Text = (this.itextSymbol_0 as IFormattedTextSymbol).Leading.ToString("#.##");
                        switch (this.esriTextHorizontalAlignment_0)
                        {
                        case esriTextHorizontalAlignment.esriTHALeft:
                            this.rdoTHALeft.Checked = true;
                            break;

                        case esriTextHorizontalAlignment.esriTHACenter:
                            this.rdoTHACenter.Checked = true;
                            break;

                        case esriTextHorizontalAlignment.esriTHARight:
                            this.rdoTHARight.Checked = true;
                            break;

                        case esriTextHorizontalAlignment.esriTHAFull:
                            this.rdoTHAFul.Checked = true;
                            break;
                        }
                        this.bool_0 = true;
                        this.method_1();
                    }
                }
            }
            catch
            {
            }
        }
 private void chkUnderline_Click(object sender, EventArgs e)
 {
     if (this.bool_0)
     {
         ITextSymbol      labelSymbol = m_pScaleBar.LabelSymbol;
         stdole.IFontDisp font        = labelSymbol.Font;
         if (font.Underline != this.chkUnderline.Checked)
         {
             font.Underline          = this.chkUnderline.Checked;
             labelSymbol.Font        = font;
             m_pScaleBar.LabelSymbol = labelSymbol;
             this.method_4();
         }
     }
 }
 private void cboFontName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (this.bool_0)
     {
         ITextSymbol      labelSymbol = m_pScaleBar.LabelSymbol;
         stdole.IFontDisp font        = labelSymbol.Font;
         if (font.Name != this.cboFontName.Name)
         {
             font.Name               = this.cboFontName.Name;
             labelSymbol.Font        = font;
             m_pScaleBar.LabelSymbol = labelSymbol;
             this.method_4();
         }
     }
 }