AddMathShape
ShapeCollection.AddMathShape-Methode
Erstellt eine neue Autoshape, die von der Standardvorlage für mathematische Inhalte angepasst wurde, und fügt sie am Ende der Sammlung hinzu.
public IAutoShape AddMathShape(float x, float y, float width, float height)
Parameter | Typ | Beschreibung |
---|---|---|
x | Einzelner Wert | Die X-Koordinate für die linke Seite des Rahmens der Form. |
y | Einzelner Wert | Die Y-Koordinate für die obere Seite des Rahmens der Form. |
width | Einzelner Wert | Die Breite des Rahmens der Form. |
height | Einzelner Wert | Die Höhe des Rahmens der Form. |
Rückgabewert
Erstelltes AutoShape-Objekt.
Beispiele
Das folgende Beispiel zeigt, wie man eine mathematische Gleichung in einer PowerPoint-Präsentation hinzufügt.
[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);
}
Siehe auch
- interface IAutoShape
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides