创建文本TIP

public ITextElement CreateTextElement(double x, double y, string text)
{
IBalloonCallout bc = CreateBallonCallout(x, y);
IRgbColor rgb = new RgbColorClass();
{
rgb.Green = 255;
}
ITextSymbol ts = new TextSymbolClass();
{
ts.Color = rgb;
}
IFormattedTextSymbol fts = ts as IFormattedTextSymbol;
{
fts.Background = bc as ITextBackground;
}
ts.Size = 18;
IPoint point = new PointClass();
{
double width = axmap.Extent.Width / 13;
double height = axmap.Extent.Height / 20;
point.PutCoords(x + width, y + height);
}
ITextElement te = new TextElementClass();
{
te.Symbol = ts;
te.Text = text;
}
IElement e = te as IElement;
{
e.Geometry = point;
}
return te;
}

posted @ 2014-08-14 14:10  相信自己_  阅读(151)  评论(0编辑  收藏  举报