Class Slide
Inheritance
System.Object
Slide
Assembly: IronPPT.dll
Syntax
public class Slide : ParentElement, ICloneableElement, IParentElement, ISlide, IGraphic, IContentElement
Slide is the page object a developer fills with content when building a PowerPoint deck in code. It holds the text, shapes, and images that appear on one slide and exposes the methods that add them, so generating a presentation comes down to creating slides and populating each one.
A slide is reached through the presentation document's slide collection, then content is added through its Add methods, which fall into clear groups. Text content uses AddText (taking a string or an IText) and AddParagraph; graphics use AddShape and the four AddImage overloads (a path, a Stream, an AnyBitmap, or an existing IImage); and AddChild adds raw content elements. What has been added is read back through the typed collection properties: Texts, Paragraphs, Shapes, Images, and TextBoxes, each a List of the matching interface.
Layout and identity are separate buckets. Geometry is set through Width, Height (both DocUnit), Position (an ElementPosition), and Angle (a Rotation), so a slide can be sized and oriented in document units rather than raw pixels. Identity and visibility live on ID, IsMasterSlide, Show and ShowMasterPlaceholderAnimations (both Nullable<bool>), and the read-only SlideColor, which reports the slide's resolved color. Set IsMasterSlide when the slide acts as a template for others, and toggle Show to control whether it appears in the rendered deck. Build a slide by adding its content first, then adjust geometry and visibility before saving the deck.
slide.AddText("Quarterly Report");
slide.AddImage("logo.png");
slide.Width = new DocUnit(960, Units.Point);
The add slide how-to creates slides, the manage slide how-to reorders them, and the slide element tutorial walks through populating one.
Constructors
Slide()
Declaration
Slide(IContentElement[])
Declaration
public Slide(params IContentElement[] children)
Parameters
Properties
Angle
Declaration
public Rotation Angle { get; set; }
Property Value
Height
Declaration
public DocUnit Height { get; set; }
Property Value
ID
Declaration
public string ID { get; set; }
Property Value
| Type |
Description |
| System.String |
|
Images
Declaration
public List<IImage> Images { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<IImage> |
|
IsMasterSlide
Declaration
public bool IsMasterSlide { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
Paragraphs
Declaration
public List<IParagraph> Paragraphs { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<IParagraph> |
|
Position
Declaration
public ElementPosition Position { get; set; }
Property Value
Shapes
Declaration
public List<IShape> Shapes { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<IShape> |
|
Show
Declaration
public Nullable<bool> Show { get; set; }
Property Value
| Type |
Description |
| System.Nullable<System.Boolean> |
|
ShowMasterPlaceholderAnimations
Declaration
public Nullable<bool> ShowMasterPlaceholderAnimations { get; set; }
Property Value
| Type |
Description |
| System.Nullable<System.Boolean> |
|
SlideColor
Declaration
public IColor SlideColor { get; }
Property Value
TextBoxes
Declaration
public List<ITextBox> TextBoxes { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<ITextBox> |
|
Texts
Declaration
public List<IText> Texts { get; }
Property Value
| Type |
Description |
| System.Collections.Generic.List<IText> |
|
Width
Declaration
public DocUnit Width { get; set; }
Property Value
Methods
AddChild(IContentElement[])
Declaration
public override void AddChild(params IContentElement[] children)
Parameters
Overrides
AddImage(IImage)
Declaration
public IImage AddImage(IImage image)
Parameters
| Type |
Name |
Description |
| IImage |
image |
|
Returns
AddImage(AnyBitmap)
Declaration
public IImage AddImage(AnyBitmap anyBitmap)
Parameters
| Type |
Name |
Description |
| IronSoftware.Drawing.AnyBitmap |
anyBitmap |
|
Returns
AddImage(Stream)
Declaration
public IImage AddImage(Stream imageStream)
Parameters
| Type |
Name |
Description |
| System.IO.Stream |
imageStream |
|
Returns
AddImage(String)
Declaration
public IImage AddImage(string imagePath)
Parameters
| Type |
Name |
Description |
| System.String |
imagePath |
|
Returns
AddParagraph(IParagraph)
Declaration
public IParagraph AddParagraph(IParagraph paragraph)
Parameters
Returns
AddShape(IShape)
Declaration
public IShape AddShape(IShape shape)
Parameters
| Type |
Name |
Description |
| IShape |
shape |
|
Returns
AddText(IText)
Declaration
public IText AddText(IText text)
Parameters
| Type |
Name |
Description |
| IText |
text |
|
Returns
AddText(String)
Declaration
public IText AddText(string text)
Parameters
| Type |
Name |
Description |
| System.String |
text |
|
Returns
Implements