Ejemplo n.º 1
0
 private void InitializeMembers()
 {
     this.m_lhDC                     = 0;
     this.m_lOldPen                  = 0;
     this.m_lPen                     = 0;
     this.m_lOldBrush                = 0;
     this.m_lBrushTop                = 0;
     this.m_lBrushLeft               = 0;
     this.m_lBrushRight              = 0;
     this.m_dDeviceRadius            = 0;
     this.m_trans                    = null;
     this.m_NumeratorTextSymbol      = new TextSymbol();
     this.m_LineSymbol               = new SimpleLineSymbol();
     this.m_DenominatorTextSymbol    = new TextSymbol();
     this.m_NumeratorText            = "AaBbYyZz";
     this.m_DenominatorText          = "AaBbYyZz";
     this.m_NumeratorTextSymbol.Text = this.m_NumeratorText;
     this.m_NumeratorTextSymbol.HorizontalAlignment = esriTextHorizontalAlignment.esriTHACenter;
     this.m_NumeratorTextSymbol.VerticalAlignment   = esriTextVerticalAlignment.esriTVABottom;
     this.m_DenominatorTextSymbol.Text = this.m_DenominatorText;
     this.m_DenominatorTextSymbol.HorizontalAlignment = esriTextHorizontalAlignment.esriTHACenter;
     this.m_DenominatorTextSymbol.VerticalAlignment   = esriTextVerticalAlignment.esriTVATop;
     this.m_lROP2  = esriRasterOpCode.esriROPCopyPen;
     this.m_Angle  = 0;
     this.m_pColor = new RgbColor();
     this.m_pFont  = new StdFont() as IFontDisp;
     this.m_HorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
     this.m_RightToLeft         = false;
     this.m_Size = 0;
     this.m_Text = "";
     this.m_VerticalAlignment = esriTextVerticalAlignment.esriTVACenter;
     this.m_bRotWithTrans     = true;
 }
Ejemplo n.º 2
0
        void ESRI.ArcGIS.esriSystem.IPersistVariant.Load(IVariantStream Stream)
        {
            int num = 0;

            num = Convert.ToInt32(Stream.Read());
            if (num > 1 | num <= 0)
            {
                throw new Exception("Failed to read from stream");
            }
            this.InitializeMembers();
            if (num == 1)
            {
                this.m_lROP2 = (esriRasterOpCode)Stream.Read();
                this.m_Size  = Convert.ToDouble(Stream.Read());
                this.m_Angle = Convert.ToDouble(Stream.Read());
                this.m_HorizontalAlignment = (esriTextHorizontalAlignment)Stream.Read();
                this.m_VerticalAlignment   = (esriTextVerticalAlignment)Stream.Read();
                this.m_RightToLeft         = Convert.ToBoolean(Stream.Read());
                this.m_Text                  = Convert.ToString(Stream.Read());
                this.m_bRotWithTrans         = Convert.ToBoolean(Stream.Read());
                this.m_lMapLevel             = Convert.ToInt32(Stream.Read());
                this.m_NumeratorText         = Convert.ToString(Stream.Read());
                this.m_DenominatorText       = Convert.ToString(Stream.Read());
                this.m_LineSymbol            = Stream.Read() as ILineSymbol;
                this.m_NumeratorTextSymbol   = Stream.Read() as ITextSymbol;
                this.m_DenominatorTextSymbol = Stream.Read() as ITextSymbol;
            }
        }
Ejemplo n.º 3
0
 protected ITextSymbol FontStyle(double double_5, esriTextHorizontalAlignment esriTextHorizontalAlignment_0,
                                 esriTextVerticalAlignment esriTextVerticalAlignment_0)
 {
     return(new TextSymbolClass
     {
         Size = double_5,
         Color = ColorManage.CreatColor(0, 0, 0),
         HorizontalAlignment = esriTextHorizontalAlignment_0,
         VerticalAlignment = esriTextVerticalAlignment_0
     });
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 文字设置
        /// </summary>
        /// <param name="txtEle"></param>
        /// <param name="size"></param>
        /// <param name="hAlignment"></param>
        /// <param name="vAligment"></param>
        protected ITextSymbol FontStyle(double size, esriTextHorizontalAlignment hAlignment,
                                        esriTextVerticalAlignment vAligment)
        {
            ITextSymbol textSymbolClass = new TextSymbol()
            {
                Size  = size,
                Color = ColorManage.CreatColor(0, 0, 0),
                HorizontalAlignment = hAlignment,
                VerticalAlignment   = vAligment
            };

            return(textSymbolClass);
        }
Ejemplo n.º 5
0
        protected ITextSymbol FontStyle(double double_2, esriTextHorizontalAlignment esriTextHorizontalAlignment_0,
                                        esriTextVerticalAlignment esriTextVerticalAlignment_0)
        {
            ITextSymbol symbol = new TextSymbolClass();
            IRgbColor   color  = new RgbColorClass
            {
                Blue  = 0,
                Red   = 0,
                Green = 0
            };

            symbol.Size  = double_2;
            symbol.Color = color;
            symbol.HorizontalAlignment = esriTextHorizontalAlignment_0;
            symbol.VerticalAlignment   = esriTextVerticalAlignment_0;
            return(symbol);
        }
Ejemplo n.º 6
0
        protected ITextSymbol FontStyle(double size, esriTextHorizontalAlignment textHorizontalAlignment,
                                        esriTextVerticalAlignment textVerticalAlignment)
        {
            ITextSymbol symbol = new TextSymbolClass();
            IRgbColor   color  = new RgbColorClass
            {
                Blue  = 0,
                Red   = 0,
                Green = 0
            };

            symbol.Size  = size;
            symbol.Color = color;
            symbol.HorizontalAlignment = textHorizontalAlignment;
            symbol.VerticalAlignment   = textVerticalAlignment;
            return(symbol);
        }
Ejemplo n.º 7
0
        private esriTextVerticalAlignment GetVerticalAlignment()
        {
            const esriTextVerticalAlignment VerticalAlignment = esriTextVerticalAlignment.esriTVABaseline;

            return(VerticalAlignment);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// 写格网的标市
 /// </summary>
 /// <param name="pPoint"></param>
 /// <param name="strText"></param>
 /// <param name="db1TextSize"></param>
 /// <param name="h_alignment"></param>
 /// <param name="v_alignment"></param>
 /// <returns></returns>
 private ITextElement DrawGridText(IPoint pPoint, string strText, double db1TextSize, esriTextHorizontalAlignment h_alignment, esriTextVerticalAlignment v_alignment)
 {
     return(null);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// 配置指定的注记要素
        /// </summary>
        /// <param name="feature">要修改的注记要素</param>
        /// <param name="pointGeometry">注记要素坐标</param>
        /// <param name="text">注记内容</param>
        /// <param name="fontSize"></param>
        /// <param name="verticalAlignment"></param>
        /// <param name="horizontalAlignment"></param>
        public void ConfigAnnotation(IFeature feature, IGeometry pointGeometry, string text, int fontSize, esriTextVerticalAlignment verticalAlignment, esriTextHorizontalAlignment horizontalAlignment)
        {
            IFontDisp font = new StdFontClass() as IFontDisp;

            font.Name = "宋体";
            font.Bold = true;

            IFormattedTextSymbol formattedTextSymbol = new TextSymbolClass();

            formattedTextSymbol.Font = font;
            formattedTextSymbol.Size = fontSize;
            formattedTextSymbol.VerticalAlignment   = verticalAlignment;
            formattedTextSymbol.HorizontalAlignment = horizontalAlignment;
            formattedTextSymbol.Angle            = 0;
            formattedTextSymbol.CharacterSpacing = 10;
            formattedTextSymbol.CharacterWidth   = 80;
            formattedTextSymbol.FlipAngle        = 90;
            formattedTextSymbol.Leading          = 0;
            formattedTextSymbol.WordSpacing      = 10;
            formattedTextSymbol.Text             = text;
            IColor rgb = new RgbColorClass();

            rgb.RGB = 15354;
            formattedTextSymbol.Color = rgb;


            ITextElement textElement = new TextElementClass();

            textElement.Symbol = formattedTextSymbol;
            textElement.Text   = text;
            IElement element = textElement as IElement;

            element.Geometry = pointGeometry;
            element.Geometry.Envelope.Width = 0.06;

            IAnnotationFeature2 annotationFeature2 = feature as IAnnotationFeature2;

            try
            {
                // annotationFeature2.Annotation.Geometry = pointGeometry;

                annotationFeature2.Annotation = element;
                annotationFeature2.Status     = esriAnnotationStatus.esriAnnoStatusPlaced;

                feature.Store();
            }
            catch { }
        }
Ejemplo n.º 10
0
        public static ITextSymbol get_TextSymbol(
			IColor a_Color,
			IColor a_Background,
			string a_Font,
			double a_Size,
			esriTextHorizontalAlignment a_Align,
			esriTextVerticalAlignment a_VAlign)
        {
            ITextSymbol theReturn = new TextSymbolClass();
            theReturn.Color = a_Color;
            theReturn.HorizontalAlignment = a_Align;
            theReturn.VerticalAlignment = a_VAlign;
            theReturn.Size = a_Size;

            IMarkerTextBackground theBackground = new MarkerTextBackgroundClass();
            theBackground.Symbol = GraphicsHelper.get_SimplePointSymbol(a_Background, a_Size+1, esriSimpleMarkerStyle.esriSMSCircle);
            theBackground.ScaleToFit = true;

            IFormattedTextSymbol theFTextSym = (IFormattedTextSymbol)theReturn;
            theFTextSym.Background = theBackground;

            return theReturn;
        }