Group Presentation Shapes in C++
Add a Group Shape
Aspose.Slides support working with group shapes on slides. This feature helps developers support richer presentations. Aspose.Slides for C++ supports adding or accessing group shapes. It is possible to add shapes to an added group shape to populate it or access any property of group shape. To add a group shape to a slide using Aspose.Slides for C++:
- Create an instance of the Presentation class.
- Obtain the reference of a slide by using its Index
- Add a group shape to the slide.
- Add the shapes to the added group shape.
- Save the modified presentation as a PPTX file.
The example below adds a group shape to a slide.
Access the AltText Property
This topic shows simple steps, complete with code examples, for adding a group shape and accessing AltText property of group shapes on slides. To access AltText of a group shape in a slide using Aspose.Slides for C++:
- Instantiate
Presentationclass that represents a PPTX file. - Obtain the reference of a slide by using its Index.
- Accessing the shape collection of slides.
- Accessing the group shape.
- Accessing the AltText property.
The example below accesses the alternative text of group shape.
FAQ
Is nested grouping (a group inside a group) supported?
Yes. GroupShape has a get_ParentGroup method, which directly indicates hierarchy support (a group can be a child of another group).
How do I control the group’s z-order relative to other objects on the slide?
Use the GroupShape’s Z-Order position to inspect its position in the display stack.
Can I prevent moving/editing/ungrouping?
Yes. The group’s lock section is exposed via get_GroupShapeLock, which lets you restrict operations on the object.