GetRect
IPortion.GetRect 方法
获取包围部分的矩形坐标。该矩形包括部分中所有文本行,包括空行。
public RectangleF GetRect()
返回值
包围部分的矩形 RectangleF
示例
示例:
[C#]
using (Presentation pres = new Presentation())
ISlide slide = pres.Slides[0];
IAutoShape shape = slide.Shapes.AddAutoShape(ShapeType.Rectangle, 50, 50, 200, 50);
shape.TextFrame.Paragraphs[0].Portions.Clear();
var portion0 = new Portion("一些文本");
var portion1 = new Portion("GetRect 文本");
shape.TextFrame.Paragraphs[0].Portions.Add(portion0);
shape.TextFrame.Paragraphs[0].Portions.Add(portion1);
RectangleF rect = shape.TextFrame.Paragraphs[0].Portions[1].GetRect();
...
另请参阅
- 接口 IPortion
- 命名空间 Aspose.Slides
- 程序集 Aspose.Slides