MathPortion
MathPortion 类
表示带有数学上下文的段。
public sealed class MathPortion : Portion, IMathPortion
构造函数
| 名称 | 描述 |
|---|---|
| MathPortion() | 初始化 MathPortion 类的新实例。 |
属性
| 名称 | 描述 |
|---|---|
| Field { get; } | 返回此段的字段。只读 IField。 |
| MathParagraph { get; } | 数学段落 |
| PortionFormat { get; } | 返回一个格式化对象,其中包含对文本段明确设置的格式属性,且不应用继承。只读 IPortionFormat。 |
| Text { get; set; } | 获取或设置段的纯文本。读/写 String。 |
方法
| 名称 | 描述 |
|---|---|
| AddField(IFieldType) | 将此段转换为自动更新的字段。 |
| AddField(string) | 将此段转换为自动更新的字段。 |
| GetCoordinates() | 获取段起始位置的坐标。点的 X 坐标表示从第一个字符(包括左侧间距)开始的段起点。Y 坐标包括顶部间距。 |
| GetRect() | 获取包围段的矩形坐标。该矩形包括段中所有文本行,包括空行。 |
| RemoveField() | 将此字段段转换为普通段。 |
示例
[C#]
using (Presentation pres = new Presentation())
{
IAutoShape shape = pres.Slides[0].Shapes.AddMathShape(0, 0, 300, 50);
IParagraph paragraph = shape.TextFrame.Paragraphs[0];
MathPortion mathPortion = new MathPortion();
paragraph.Portions.Add(mathPortion);
}
另见
- 类 Portion
- 接口 IMathPortion
- 命名空间 Aspose.Slides.MathText
- 程序集 Aspose.Slides