Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to use the Zoom commands (Zoom In, zoom out) for a MapControl. But it doesn't make "Text elements" bigger (larger) or smaller. Please see my image.

enter image description here

I used the below function to add a text into MapControl:

public void AddTextElement(AxESRI.ArcGIS.Controls.AxMapControl map, IPoint point, string strText, string fontName, int size, double degree, short weight)
        {
            IGraphicsContainer pGraphicsContainer = map.ActiveView.GraphicsContainer;
            ITextElement pTextElement = new TextElementClass();
            IElement pElement;
            IRgbColor pColor;

            IFontDisp pFont = new StdFontClass() as IFontDisp;
            pColor = new RgbColorClass();
            pColor.Red = 0;
            pColor.Green = 0;
            pColor .Blue = 0;
            pFont.Name = fontName;
            pFont.Weight = weight;
            pFont.Size = size;

            IFormattedTextSymbol formatTextSyl = new TextSymbolClass();
            formatTextSyl.Font = pFont;            
            formatTextSyl.HorizontalAlignment = esriTextHorizontalAlignment.esriTHALeft;
            formatTextSyl.Angle = degree;

            pTextElement.Text = strText;
            pTextElement.Symbol = (ITextSymbol)formatTextSyl;


            pElement = (IElement)pTextElement;
            pElement.Geometry = (IGeometry)point;

            pGraphicsContainer.AddElement(pElement, 0);
            IActiveView activeView = map.ActiveView;
            activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}

Are there something wrong ?

share|improve this question
    
Can you help me ? –  taibc Nov 3 '12 at 4:14
    
Are there anyone know how to fix it ? –  taibc Nov 5 '12 at 3:18
    
I resolved this problem by setting for ReferenceScale and MapUnit. Regards –  taibc Nov 8 '12 at 3:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.