WPF

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IBaseSlide - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IBaseSlide

    Represents a base slide in a presentation.

    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface IBaseSlide
    Remarks

    Contains members which are common for slide, layout slide and master slide.

    Properties

    Background

    Gets the background of a slide. Read-only.

    Declaration
    IBackground Background { get; }
    Property Value
    Type Description
    IBackground
    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation.
    ISlide slide = presentation.Slides.Add();
    //Retrieve the background.
    IBackground background = slide.Background;
    //Retrieve the fill of the background.
    IFill fill = background.Fill;
    //Set the fill type as gradient.
    fill.FillType = FillType.Gradient;
    //Retrieve the gradient fill.
    IGradientFill gradientFill = fill.GradientFill;
    //Add the first gradient stop.
    gradientFill.GradientStops.Add();
    //Add the second gradient stop.
    gradientFill.GradientStops.Add();
    //Save the presentation.
    presentation.Save("Output.pptx");
    //Close the presentation.
    presentation.Close();        
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = presentation__1.Slides.Add()
    'Retrieve the background.
    Dim background As IBackground = slide.Background
    'Retrieve the fill of the background.
    Dim fill As IFill = background.Fill
    'Set the fill type as gradient.
    fill.FillType = FillType.Gradient
    'Retrieve the gradient fill.
    Dim gradientFill As IGradientFill = fill.GradientFill
    'Add the first gradient stop.
    gradientFill.GradientStops.Add()
    'Add the second gradient stop.
    gradientFill.GradientStops.Add()
    'Save the presentation.
    presentation__1.Save("Output.pptx")
    'Close the presentation.
    presentation__1.Close()

    Charts

    Gets an IPresentationCharts collection that represents the charts in a slide. Read-only.

    Declaration
    IPresentationCharts Charts { get; }
    Property Value
    Type Description
    IPresentationCharts
    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Get the chart collection from slide
    IPresentationCharts charts = slide.Charts;
    //Add chart to slide
    IPresentationChart chart =charts.AddChart(400, 300, 100, 100);
    //Set the chart title
    chart.ChartTitle = "Chart";
    //Save the presentation
    presentation.Save("Output.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)
    'Get the chart collection from slide
    Dim charts As IPresentationCharts = slide.Charts
    'Add chart to slide
    Dim chart As IPresentationChart = charts.AddChart(400, 300, 100, 100)
    'Set the chart title
    chart.ChartTitle = "Chart"
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()

    GroupShapes

    Gets an IGroupShapes instance that represents the GroupShape collection in a slide. Read-only.

    Declaration
    IGroupShapes GroupShapes { get; }
    Property Value
    Type Description
    IGroupShapes
    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, it is read only
    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);
    //Save the presentation
    presentation.Save("GroupShapes.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, it is read only
    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)
    'Save the presentation
    presentation__1.Save("GroupShapes.pptx")
    'Close the presentation
    presentation__1.Close()

    HeadersFooters

    Gets a HeadersFooters for the specified slide.

    Declaration
    IHeadersFooters HeadersFooters { get; }
    Property Value
    Type Description
    IHeadersFooters
    Remarks

    Returns an IHeadersFooters object that represents the HeaderFooter collection of a slide.

    Name

    Gets or sets the name of a slide.

    Declaration
    string Name { get; set; }
    Property Value
    Type Description
    System.String
    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Set the name of the slide
    slide.Name = "My Slide";
    //Save the presentation
    presentation.Save("Slide.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)
    'Set the name of the slide
    slide.Name = "My Slide"
    'Save the presentation
    presentation__1.Save("Slide.pptx")
    'Close the presentation
    presentation__1.Close()

    Pictures

    Gets an IPictures instance that represents the collection of all pictures in a slide. Read-only.

    Declaration
    IPictures Pictures { get; }
    Property Value
    Type Description
    IPictures
    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 shapes collection
    IShapes shapes = slide.Shapes;
    //Get the image from file path
    Image image = Image.FromFile("Image.gif");
    // Add the image to the slide by specifying position and size
    shapes.AddPicture(new MemoryStream(image.ImageData), 300, 120, 70, 40);
    //Save the presentation
    presentation.Save("Picture.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)
    'Get the image from file path
    Dim image__2 As Image = Image.FromFile("Image.gif")
    ' Add the image to the slide by specifying position and size
    shapes.AddPicture(New MemoryStream(image__2.ImageData), 300, 120, 70, 40)
    'Save the presentation
    presentation__1.Save("Picture.pptx")
    'Close the presentation
    presentation__1.Close()

    Shapes

    Gets a IShapes collection that represents all the elements in the slide. Read-only.

    Declaration
    IShapes Shapes { get; }
    Property Value
    Type Description
    IShapes
    Remarks

    The IShapes collection can contain the drawings, shapes, pictures, text objects, titles, headers, footers, slide numbers, and date and time objects on a slide.

    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 shapes collection
    IShapes shapes = slide.Shapes;
    //Add auto shape - rectangle to slide
    IShape shape = shapes.AddShape(AutoShapeType.Rectangle,300,400,150,200);
    //Save the presentation
    presentation.Save("Shapes.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 shapes collection
    Dim shapes As IShapes = slide.Shapes
    'Add auto shape - rectangle to slide
    Dim shape As IShape = shapes.AddShape(AutoShapeType.Rectangle, 300, 400, 150, 200)
    'Save the presentation
    presentation__1.Save("Shapes.pptx")
    'Close the presentation
    presentation__1.Close()

    SlideSize

    Gets the slide size for the presentation. Read-only.

    Declaration
    ISlideSize SlideSize { get; }
    Property Value
    Type Description
    ISlideSize
    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a blank slide to the presentation.
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Retrieve the side size
    ISlideSize slideSize = slide.SlideSize;
    //Set slide orientation
    slideSize.SlideOrientation = SlideOrientation.Landscape;
    //Save the presentation
    presentation.Save("Output.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)
    'Retrieve the side size
    Dim slideSize As ISlideSize = slide.SlideSize
    'Set slide orientation
    slideSize.SlideOrientation = SlideOrientation.Landscape
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()

    SlideTransition

    Get the slide transition for the presentation. Read-only.

    Declaration
    ISlideShowTransition SlideTransition { get; }
    Property Value
    Type Description
    ISlideShowTransition
    Examples
    //Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    //Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    //Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    //Get the slide transition value
    ISlideShowTransition transition = slide.SlideTransition;
    //Add slide transition for slide
    transition.TransitionEffect = TransitionEffect.Airplane;
    //Save the presentation file
    ppDoc.Save("Sample.pptx");
    //Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Get the slide transition value
    Dim transition As ISlideShowTransition = slide.SlideTransition
    'Add slide transition for slide
    transition.TransitionEffect = TransitionEffect.Airplane
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    Tables

    Gets an ITables collection that represents the tables in a slide. Read-only.

    Declaration
    ITables Tables { get; }
    Property Value
    Type Description
    ITables
    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 to hold table collection
    ITables tables = slide.Tables;
    //Add table to the slide
    ITable table = tables.AddTable(2, 2, 100, 120, 300, 200);
    //Retrieve each cell and fill text content to the cell.
    ICell cell = table[0, 0];
    cell.TextBody.AddParagraph("First Row and First Column");
    cell = table[0, 1];
    cell.TextBody.AddParagraph("First Row and Second Column");
    cell = table[1, 0];
    cell.TextBody.AddParagraph("Second Row and First Column");
    cell = table[1, 1];
    cell.TextBody.AddParagraph("Second Row and Second Column");
    //Give simple description to table shape
    table.Description = "Table arrangement";
    //Save the presentation
    presentation.Save("Output.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 to hold table collection
    Dim tables As ITables = slide.Tables
    'Add table to the slide
    Dim table As ITable = tables.AddTable(2, 2, 100, 120, 300, 200)
    'Retrieve each cell and fill text content to the cell.
    Dim cell As ICell = table(0, 0)
    cell.TextBody.AddParagraph("First Row and First Column")
    cell = table(0, 1)
    cell.TextBody.AddParagraph("First Row and Second Column")
    cell = table(1, 0)
    cell.TextBody.AddParagraph("Second Row and First Column")
    cell = table(1, 1)
    cell.TextBody.AddParagraph("Second Row and Second Column")
    'Give simple description to table shape
    table.Description = "Table arrangement"
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()

    Timeline

    Get the timeline(Animation) of the slide

    Declaration
    IAnimationTimeline Timeline { get; }
    Property Value
    Type Description
    IAnimationTimeline
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Get the timeline(Animation) of the slide
    IAnimationTimeline timeLine = slide.Timeline;
    // Add animation effect on the slide with shape
    IEffect effect = timeLine.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick);
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Get the timeline(Animation) of the slide
    Dim timeLine As IAnimationTimeLine  = slide.TimeLine;
    'Add animation effect on the slide with shape
    Dim effect As IEffect = timeLine.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick)
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved