我正在使用此代碼在ArcMap中創建文本。但當我放大時,我似乎無法像註釋文本那樣將其縮放。有沒有辦法讓圖形文本在ArcMap中縮放?
有沒有人知道如何做到這一點?
//'First setup a color. We'll use RGB red
IRgbColor pRGBcolor = new RgbColor();
pRGBcolor.Blue = 0;
pRGBcolor.Red = 255;
pRGBcolor.Green = 0;
//'Next, cocreate a new TextElement
ITextElement pTextElement = new TextElementClass();
//'Query Interface (QI) to an IElement pointer and set
//'the geometry that was passed in
IElement pElement = pTextElement as IElement;
pElement.Geometry = Point;
//'Next, setup a font
stdole.IFontDisp pFontDisp = new stdole.StdFont() as stdole.IFontDisp;
pFontDisp.Name = "Arial";
pFontDisp.Bold = true;
//'Next, setup a TextSymbol that the TextElement will draw with
ITextSymbol pTextSymbol = new ESRI.ArcGIS.Display.TextSymbolClass();
pTextSymbol.Font = pFontDisp;
pTextSymbol.Color = pRGBcolor;
pTextSymbol.Size = Size;
pTextSymbol.HorizontalAlignment = esriTextHorizontalAlignment.esriTHACenter;
pTextSymbol.VerticalAlignment = esriTextVerticalAlignment.esriTVACenter;
pTextSymbol.Angle = Angle;
pTextSymbol.Text = Text;
//'set the size of the text symbol here, rather than on the font
//'Next, Give the TextSymbol and text string to the TextElement
pTextElement.Symbol = pTextSymbol;
pTextElement.Text = pTextSymbol.Text;
pTextElement.ScaleText = true;
ESRI.ArcGIS.Carto.IElementProperties3 aoElementPro = pTextElement as ESRI.ArcGIS.Carto.IElementProperties3;
aoElementPro.ReferenceScale = cGISHelpers.MapDomain.Map.MapScale;
我正在構建一個將尺寸放在包裹上的工具。我們需要讓客戶端變得非常容易,因此我試圖使用圖形文本來定位和設置文本的大小,然後在用戶對文本所在的位置感到滿意後,該工具將其保存在註釋層中。 – 2009-05-21 14:14:43