Interface ISlideItem
Represents an individual item in a slide.
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.NET.dll
Syntax
public interface ISlideItem
Properties
Description
Gets or sets the item description.
Declaration
string Description { get; set; }
Property Value
Type | Description |
---|---|
System.String | The description of the shape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the description for slide item
slideItem.Description = "This is a SlideItem";
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the description for slide item
slideItem.Description = "This is a SlideItem"
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Height
Gets or sets height. The Height value ranges from 0 to 169056, in points.
Declaration
double Height { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of the shape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the height
slideItem.Height = 200;
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the height
slideItem.Height = 200
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Hidden
Gets or sets the boolean value which indicates whether the shape is hidden or not.
Declaration
bool Hidden { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Hide the shape from slide
slideItem.Hidden = true;
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Hide the shape from slide
slideItem.Hidden = True
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Left
Gets or sets left position. The Left value ranges from -169056 to 169056, in points.
Declaration
double Left { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The left position of the shape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the Left
slideItem.Left = 120;
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the Left
slideItem.Left = 120
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
LineFormat
Gets an ILineFormat instance which represents the line and arrowhead properties. Read only.
Declaration
ILineFormat LineFormat { get; }
Property Value
Type | Description |
---|---|
ILineFormat | The line format object of the shape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the length of begin arrow head of line format
slideItem.LineFormat.BeginArrowheadLength = ArrowheadLength.Long;
//Set the dash style of line format
slideItem.LineFormat.DashStyle = LineDashStyle.DashDotDot;
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the length of begin arrow head of line format
slideItem.LineFormat.BeginArrowheadLength = ArrowheadLength.[Long]
'Set the dash style of line format
slideItem.LineFormat.DashStyle = LineDashStyle.DashDotDot
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
ShapeName
Gets or sets the shape name.
Declaration
string ShapeName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the shape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the shape name for the slide item
slideItem.ShapeName = "SlideItem";
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the shape name for the slide item
slideItem.ShapeName = "SlideItem"
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
SlideItemType
Gets the slide item type. Read-only.
Declaration
SlideItemType SlideItemType { get; }
Property Value
Type | Description |
---|---|
SlideItemType | The type of the slide item. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the description for slide item
slideItem.Description = "This is a SlideItem";
//Set the title
slideItem.Title = "SlideItem";
//Get the type of slide item, it is read only
SlideItemType type = slideItem.SlideItemType;
//Add the slide item to shape collection
slide.Shapes.Add(slideItem);
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the description for slide item
slideItem.Description = "This is a SlideItem"
'Set the title
slideItem.Title = "SlideItem"
'Get the type of slide item, it is read only
Dim type As SlideItemType = slideItem.SlideItemType
'Add the slide item to shape collection
slide.Shapes.Add(slideItem)
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Title
Gets or sets the shape title.
Declaration
string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The title of the shape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the title
slideItem.Title = "SlideItem";
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the title
slideItem.Title = "SlideItem"
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Top
Gets or sets top position. The Top value ranges from -169056 to 169056, in points.
Declaration
double Top { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The top position of the shape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the Top
slideItem.Top = 100;
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the Top
slideItem.Top = 110
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Width
Gets or sets width. The Width value ranges from 0 to 169056, in points.
Declaration
double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The width of the shape. |
Examples
//Create a new presentation.
IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
IShape shape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Create instance for SlideItem
ISlideItem slideItem = slide.Shapes[0];
//Set the Width
slideItem.Width = 250;
//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)
'Add a rectangle to the slide
Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Create instance for SlideItem
Dim slideItem As ISlideItem = slide.Shapes(0)
'Set the Width
slideItem.Width = 300
'Save the presentation
presentation__1.Save("Sample.pptx")
'Close the presentation
presentation__1.Close()
Methods
Clone()
Creates a copy of the ISlideItem instance.
Declaration
ISlideItem Clone()
Returns
Type | Description |
---|---|
ISlideItem | Returns the cloned instance |
Examples
//Create a new presentation.
IPresentation pptxDoc = Presentation.Create();
//Add a slide to the presentation.
ISlide slide = pptxDoc.Slides.Add(SlideLayoutType.Blank);
//Add a rectangle to the slide
ISlideItem slideItem = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100);
//Clone the slide item.
ISlideItem clonedSlideItem = slideItem.Clone();
//Add the slide item to the shape collection.
slide.Shapes.Add(clonedSlideItem);
//Modifying the top position value.
clonedSlideItem.Top = 250;
//Add text content to the cloned slide item.
(clonedSlideItem as IShape).TextBody.Text = "Cloned slide item";
//Saves the Presentation to the file system.
pptxDoc.Save("Result.pptx");
//Closes the Presentation.
pptxDoc.Close();
'Create a new presentation.
Dim pptxDoc As IPresentation = Presentation.Create()
'Add a blank slide to the presentation.
Dim slide As ISlide = pptxDoc.Slides.Add(SlideLayoutType.Blank)
'Add a rectangle to the slide
Dim slideItem As ISlideItem = slide.Shapes.AddShape(AutoShapeType.Rectangle, 100, 100, 100, 100)
'Clone the slide item.
Dim clonedSlideItem As ISlideItem = slideItem.Clone()
'Add the slide item to the shape collection.
slide.Shapes.Add(clonedSlideItem)
'Modifying the top position value.
clonedSlideItem.Top = 250
'Add text content to the cloned slide item.
TryCast(clonedSlideItem, IShape).TextBody.Text = "Cloned slide item"
'Save the presentation
pptxDoc.Save("Result.pptx")
'Close the presentation
pptxDoc.Close()