Zooming MapControl doesn't effect ?

549
3
Jump to solution
11-01-2012 01:48 AM
TaiBui
by
Occasional Contributor II
Hi,

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.

[ATTACH=CONFIG]18926[/ATTACH]

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 ?
0 Kudos
1 Solution

Accepted Solutions
TaiBui
by
Occasional Contributor II
I resolved this problem after set the values: RefenceScale and MapUnit   for the map

View solution in original post

0 Kudos
3 Replies
NeilClemmons
Regular Contributor III
You need to set ITextElement.ScaleText.
0 Kudos
TaiBui
by
Occasional Contributor II
You need to set ITextElement.ScaleText.


Thanks  Neil, I added the statement: pTextElement.ScaleText = true   above the below statements, but it is not successful:

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


Do you know why ?

Thanks and regards,
0 Kudos
TaiBui
by
Occasional Contributor II
I resolved this problem after set the values: RefenceScale and MapUnit   for the map
0 Kudos