文本风格类,用于设置 GeoText类实例的风格。

命名空间:  SuperMap.Data
程序集:  SuperMap.Data (in SuperMap.Data)
版本: dll

语法

C#
public class TextStyle : IDisposable

备注

当TextStyle对象实例进行 Dispose释放后再调用该对象成员,将引发ObjectDisposedException异常。

示例

以下代码示范如何将自定义的文本风格应用于文本对象。

CopyC#
public static void TextStyleExamples()
{
    // 设置文本风格
    TextStyle textStyle = new TextStyle();
    textStyle.Rotation = 30.0;
    textStyle.Shadow = true;
    textStyle.Alignment = TextAlignment.TopCenter;
    textStyle.BackColor = System.Drawing.Color.Blue;
    textStyle.ForeColor = System.Drawing.Color.Black;
    textStyle.BackOpaque = true;
    textStyle.Bold = true;
    textStyle.FontName = "宋体";
    textStyle.FontHeight = 100.0;
    textStyle.FontWidth = 100.0;
    textStyle.IsSizeFixed = true;
    textStyle.Italic = true;
    textStyle.Outline = true;
    textStyle.Strikeout = true;
    textStyle.Underline = true;
    textStyle.Weight = 500;
    Console.WriteLine("文本风格为:" + textStyle.ToString());

    // 将文本风格应用于文本对象
    GeoText geotext = new GeoText();
    TextPart part = new TextPart("SuperMap", new Point2D(150, 150), 10.0);
    geotext.AddPart(part);
    geotext.TextStyle = textStyle;
}

继承层次

System..::.Object
  SuperMap.Data..::.TextStyle

版本信息

SuperMap iObjects .NET


SuperMap Objects .NET

受以下版本支持: 6.1.3

请参见