AddMathShape
ShapeCollection.AddMathShape méthode
Crée une nouvelle forme Autoshape adaptée du modèle par défaut au contenu mathématique et l’ajoute à la fin de la collection.
public IAutoShape AddMathShape(float x, float y, float width, float height)
Paramètre | Type | Description |
---|---|---|
x | Single | La coordonnée X pour le côté gauche du cadre de la forme. |
y | Single | La coordonnée Y pour le côté supérieur du cadre de la forme. |
width | Single | La largeur du cadre de la forme. |
height | Single | La hauteur du cadre de la forme. |
Valeur de Retour
Objet AutoShape créé.
Exemples
L’exemple suivant montre comment ajouter une Équation Mathématique dans une Présentation PowerPoint.
[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);
}
Voir Aussi
- interface IAutoShape
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides