AddMathShape
ShapeCollection.AddMathShape method
Creates a new Autoshape tuned from default template to math content and adds it to the end of the collection.
public IAutoShape AddMathShape(float x, float y, float width, float height)
Parameter | Type | Description |
---|---|---|
x | Single | The X-coordinate for a left side of shape’s frame. |
y | Single | The Y-coordinate for a top side of shape’s frame. |
width | Single | The width of shape’s frame. |
height | Single | The height of shape’s frame. |
Return Value
Created AutoShape object.
Examples
The following example shows how to add Mathematical Equation in PowerPoint Presentation.
[C#]
using (Presentation pres = new Presentation())
{
IAutoShape mathShape = pres.Slides[0].Shapes.AddMathShape(0, 0, 720, 150);
var mathParagraph = (mathShape.TextFrame.Paragraphs[0].Portions[0] as MathPortion).MathParagraph;
var fraction = new MathematicalText("x").Divide("y");
mathParagraph.Add(new MathBlock(fraction));
var mathBlock = new MathematicalText("c")
.SetSuperscript("2")
.Join("=")
.Join(new MathematicalText("a").SetSuperscript("2"))
.Join("+")
.Join(new MathematicalText("b").SetSuperscript("2"));
mathParagraph.Add(mathBlock);
pres.Save("math.pptx", SaveFormat.Pptx);
}
See Also
- interface IAutoShape
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides