AddGroupShape
Inhalt
[
Ausblenden
]AddGroupShape()
Erstellt eine neue GroupShape und fügt sie am Ende der Sammlung hinzu. Die Größe und Position des GroupShape-Rahmens werden an den Inhalt angepasst, wenn eine neue Form in das GroupShape hinzugefügt wird.
public IGroupShape AddGroupShape()
Rückgabewert
Erstelltes GroupShape-Objekt.
Beispiele
Das folgende Beispiel zeigt, wie man eine Gruppenform zu einer Folie der PowerPoint-Präsentation hinzufügt.
[C#]
// Präsentation-Klasse instanziieren
using (Presentation pres = new Presentation())
{
// Die erste Folie abrufen
ISlide sld = pres.Slides[0];
// Zugriff auf die Formensammlung der Folien
IShapeCollection slideShapes = sld.Shapes;
// Eine Gruppenform zur Folie hinzufügen
IGroupShape groupShape = slideShapes.AddGroupShape();
// Formen innerhalb der hinzugefügten Gruppenform hinzufügen
groupShape.Shapes.AddAutoShape(ShapeType.Rectangle, 300, 100, 100, 100);
groupShape.Shapes.AddAutoShape(ShapeType.Rectangle, 500, 100, 100, 100);
groupShape.Shapes.AddAutoShape(ShapeType.Rectangle, 300, 300, 100, 100);
groupShape.Shapes.AddAutoShape(ShapeType.Rectangle, 500, 300, 100, 100);
// Gruppenformrahmen hinzufügen
groupShape.Frame = new ShapeFrame(100, 300, 500, 40, NullableBool.False, NullableBool.False, 0);
// Die PPTX-Datei auf der Festplatte speichern
pres.Save("GroupShape_out.pptx", SaveFormat.Pptx);
}
Siehe auch
- interface IGroupShape
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides
AddGroupShape(ISvgImage, float, float, float, float)
Erstellt eine neue GroupShape, füllt sie mit konvertierten Formen aus SVG und fügt sie am Ende der Sammlung hinzu.
public IGroupShape AddGroupShape(ISvgImage svgImage, float x, float y, float width, float height)
Parameter | Typ | Beschreibung |
---|---|---|
svgImage | ISvgImage | Svg-Bildobjekt ISvgImage |
x | Single | Die X-Koordinate für die linke Seite des Gruppenformrahmens. |
y | Single | Die Y-Koordinate für die obere Seite des Gruppenformrahmens. |
width | Single | Die Breite der Gruppe des Gruppenformrahmens. |
height | Single | Die Höhe einer Gruppe des Gruppenformrahmens. |
Rückgabewert
Erstelltes GroupShape-Objekt.
Siehe auch
- interface IGroupShape
- interface ISvgImage
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides