public static IElement CreateTextElement(IPoint point, IColor color, string text, IFontConfig fontConfig) { stdole.IFontDisp fontDisp = new StdFontClass() as IFontDisp; fontDisp.Name = fontConfig.Font.Name; fontDisp.Size = (decimal)fontConfig.Font.Size; fontDisp.Italic = fontConfig.Font.Italic; fontDisp.Underline = fontConfig.Font.Underline; fontDisp.Bold = fontConfig.Font.Bold; fontDisp.Strikethrough = fontConfig.Font.Strikeout; ITextSymbol textSymbol = new TextSymbolClass(); textSymbol.Font = fontDisp; textSymbol.Color = color; textSymbol.HorizontalAlignment = esriTextHorizontalAlignment.esriTHACenter; textSymbol.VerticalAlignment = esriTextVerticalAlignment.esriTVACenter; ITextElement textElement = new TextElementClass(); textElement.Symbol = textSymbol; textElement.ScaleText = true; textElement.Text = text; IElement element = textElement as IElement; element.Geometry = point; return(element); }
public Tag(string value, Rectangle rectangle, IFontConfig fontConfig) { Value = value; Rectangle = rectangle; FontConfig = fontConfig; }