IPortionGetRect Method

Get coordinates of rect that bounds portion. The rect includes all the lines of text in portion, including empty ones.

Namespace:  Aspose.Slides
Assembly:  Aspose.Slides (in Aspose.Slides.dll) Version: 21.12.0.0 (21.12)
Syntax
RectangleF GetRect()

Return Value

Type: RectangleF
Rectangle that bounds portion RectangleF
Examples
Example:
 [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("Some text");
    var portion1 = new Portion("GetRect text");

    shape.TextFrame.Paragraphs[0].Portions.Add(portion0);
    shape.TextFrame.Paragraphs[0].Portions.Add(portion1);

    RectangleF rect = shape.TextFrame.Paragraphs[0].Portions[1].GetRect();
    ...
}
See Also