Interface IGroupShapes
Represents a collection of IGroupShape instance in a slide.
Inherited Members
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface IGroupShapes : IEnumerable<IGroupShape>, IEnumerable
Properties
Count
Gets the number of elements in the group shape collection. Read-only.
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The count. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Create instance for group shapes
IGroupShapes groupShapes = slide.GroupShapes;
//Add group shape to the collection
IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 300, 350);
IGroupShape groupShape2 = groupShapes.AddGroupShape(34, 50, 200, 100);
IGroupShape groupShape3 = groupShapes.AddGroupShape(70, 30, 120, 100);
//Get the count of group shapes collection
int count = groupShapes.Count;
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a blank slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Create instance for group shapes
Dim groupShapes As IGroupShapes = slide.GroupShapes
'Add group shape to the collection
Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 300, 350)
Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(34, 50, 200, 100)
Dim groupShape3 As IGroupShape = groupShapes.AddGroupShape(70, 30, 120, 100)
'Get the count of group shapes collection
Dim count As Integer = groupShapes.Count
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Item[Int32]
Gets a IGroupShape instance from the collection. Read-only.
Declaration
IGroupShape this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index from the collection. |
Property Value
Type | Description |
---|---|
IGroupShape | The IGroupShape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Create instance for group shapes
IGroupShapes groupShapes = slide.GroupShapes;
//Add group shape to the collection
IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 300, 350);
IGroupShape groupShape2 = groupShapes.AddGroupShape(34, 50, 200, 100);
IGroupShape groupShape3 = groupShapes.AddGroupShape(70, 30, 120, 100);
//To access a specific group shape in the collection
IGroupShape groupShape = groupShapes[0];
//Set the description
groupShape.Description = "First group shape";
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a blank slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Create instance for group shapes
Dim groupShapes As IGroupShapes = slide.GroupShapes
'Add group shape to the collection
Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 300, 350)
Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(34, 50, 200, 100)
Dim groupShape3 As IGroupShape = groupShapes.AddGroupShape(70, 30, 120, 100)
'To access a specific group shape in the collection
Dim groupShape As IGroupShape = groupShapes(0)
'Set the description
groupShape.Description = "First group shape"
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Methods
AddGroupShape(Double, Double, Double, Double)
Creates a group shape and adds the group shape to the shape collection.
Declaration
IGroupShape AddGroupShape(double left, double top, double width, double height)
Parameters
Type | Name | Description |
---|---|---|
System.Double | left | Represents the left position, in points. The Left value ranges from -169056 to 169056. |
System.Double | top | Represents the top position, in points. The Top value ranges from -169056 to 169056. |
System.Double | width | Represents the width, in points. The Width value ranges from 0 to 169056. |
System.Double | height | Represents the height, in points. The Height value ranges from 0 to 169056. |
Returns
Type | Description |
---|---|
IGroupShape | Returns an IGroupShape instance this method creates. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Create instance for group shapes
IGroupShapes groupShapes = slide.GroupShapes;
//Add group shape to the collection
IGroupShape groupShape = groupShapes.AddGroupShape(12, 12, 300, 350);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a blank slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Create instance for group shapes
Dim groupShapes As IGroupShapes = slide.GroupShapes
'Add group shape to the collection
Dim groupShape As IGroupShape = groupShapes.AddGroupShape(12, 12, 300, 350)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
IndexOf(IGroupShape)
Returns the zero-based index of the first occurrence of the IGroupShape instance within the collection.
Declaration
int IndexOf(IGroupShape groupShape)
Parameters
Type | Name | Description |
---|---|---|
IGroupShape | groupShape | The IGroupShape instance to locate in the collection. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the zero-based index of the first occurrence of the specified group shape within the collection, if found; otherwise, –1. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Create instance for group shapes
IGroupShapes groupShapes = slide.GroupShapes;
//Add group shape to the collection
IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 300, 350);
IGroupShape groupShape2 = groupShapes.AddGroupShape(34, 50, 200, 100);
IGroupShape groupShape3 = groupShapes.AddGroupShape(70, 30, 120, 100);
//Get the index of added group shape
int index = groupShapes.IndexOf(groupShape1);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a blank slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Create instance for group shapes
Dim groupShapes As IGroupShapes = slide.GroupShapes
'Add group shape to the collection
Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 300, 350)
Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(34, 50, 200, 100)
Dim groupShape3 As IGroupShape = groupShapes.AddGroupShape(70, 30, 120, 100)
'Get the index of added group shape
Dim index As Integer = groupShapes.IndexOf(groupShape1)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Remove(IGroupShape)
Removes the first occurrence of a specified IGroupShape instance from the group shape collection.
Declaration
void Remove(IGroupShape groupShape)
Parameters
Type | Name | Description |
---|---|---|
IGroupShape | groupShape | The group shape object to be removed from the collection. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Create instance for group shapes
IGroupShapes groupShapes = slide.GroupShapes;
//Add group shape to the collection
IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 300, 350);
IGroupShape groupShape2 = groupShapes.AddGroupShape(34, 50, 200, 100);
IGroupShape groupShape3 = groupShapes.AddGroupShape(70, 30, 120, 100);
//Remove a group shape instance from collection
groupShapes.Remove(groupShape2);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a blank slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Create instance for group shapes
Dim groupShapes As IGroupShapes = slide.GroupShapes
'Add group shape to the collection
Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 300, 350)
Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(34, 50, 200, 100)
Dim groupShape3 As IGroupShape = groupShapes.AddGroupShape(70, 30, 120, 100)
'Remove a group shape instance from collection
groupShapes.Remove(groupShape2)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
RemoveAt(Int32)
Removes the element at the specified index of the group shape collection.
Declaration
void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the group shape object to be removed. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Create instance for group shapes
IGroupShapes groupShapes = slide.GroupShapes;
//Add group shape to the collection
IGroupShape groupShape1 = groupShapes.AddGroupShape(12, 12, 300, 350);
IGroupShape groupShape2 = groupShapes.AddGroupShape(34, 50, 200, 100);
IGroupShape groupShape3 = groupShapes.AddGroupShape(70, 30, 120, 100);
//Remove an item from specific index.
groupShapes.RemoveAt(0);
//Save the presentation
presentation.Save("Sample.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As IPresentation = Presentation.Create()
'Add a blank slide to the presentation.
Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
'Create instance for group shapes
Dim groupShapes As IGroupShapes = slide.GroupShapes
'Add group shape to the collection
Dim groupShape1 As IGroupShape = groupShapes.AddGroupShape(12, 12, 300, 350)
Dim groupShape2 As IGroupShape = groupShapes.AddGroupShape(34, 50, 200, 100)
Dim groupShape3 As IGroupShape = groupShapes.AddGroupShape(70, 30, 120, 100)
'Remove an item from specific index.
groupShapes.RemoveAt(0)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()