Search Results for

    Show / Hide Table of Contents

    Class Shape

    Inheritance
    System.Object
    ContentElement
    ParentElement
    BaseGraphicContainer
    Shape
    TextBox
    Implements
    ICloneableElement
    IParentElement
    IShape
    IGraphic
    IContentElement
    Inherited Members
    BaseGraphicContainer.Resize(Int32, Int32)
    BaseGraphicContainer.Rotate(Double)
    BaseGraphicContainer.FlipHorizontal()
    BaseGraphicContainer.FlipVertical()
    BaseGraphicContainer.Height
    BaseGraphicContainer.Position
    BaseGraphicContainer.Width
    BaseGraphicContainer.Angle
    ParentElement.AddChild(IContentElement[])
    ParentElement.InsertChildToIndex(Int32, IContentElement[])
    ParentElement.Remove()
    ParentElement.RemoveChildren(IContentElement[])
    ParentElement.RemoveAllChildren()
    ParentElement.ExtractElements<T>()
    ParentElement.GetChildByIndex<T>(Int32)
    ParentElement.CloneElement<T>(T)
    ParentElement.LogObjectTree()
    ParentElement.Children
    ContentElement._Index
    ContentElement.Replace(IContentElement)
    ContentElement.GetIndex()
    ContentElement.CloneObject<T>(T)
    ContentElement.CaptureInitialValues()
    ContentElement.Index
    ContentElement.Parent
    ContentElement.Status
    Namespace: IronPPT.Models
    Assembly: IronPPT.dll
    Syntax
    public class Shape : BaseGraphicContainer, ICloneableElement, IParentElement, IShape, IGraphic, IContentElement

    Drawing a shape onto a slide, an arrow, rectangle, or circle that structures content or draws the eye, runs through Shape. It models a single graphic placed on a slide, with its own type, colors, and identity, so a developer can build diagrams and callouts directly from code.

    A developer creates one with new Shape() and adds it to a slide through Slide.AddShape, which accepts the shape and returns an IShape. The Type property, a Nullable<ShapeType>, picks the geometry from the ShapeType enum (a triangle, rectangle, or one of the other preset forms). FillColor and OutlineColor are IColor values that set the interior and the border. Name gives the shape a readable label and Id (a uint) is its identifier within the slide. The Clone method returns a copy as an IContentElement, handy for repeating a styled shape across slides.

    Set Type first so the shape has a geometry, then assign FillColor and OutlineColor for its look; size and position come from the inherited graphic members. The ShapeType enum covers the common preset forms, so picking a member is how a developer chooses between an arrow, a rectangle, an oval, and the rest without drawing geometry by hand. Because Shape is a content element, the same instance can be added, cloned, and re-styled without rebuilding it from scratch, which keeps diagram-generation code compact. When a slide needs several similar shapes, build one, set its type and colors, and use Clone to stamp out the variants rather than repeating the setup.

    var shape = new Shape();
    shape.Type = ShapeType.Triangle;
    shape.OutlineColor = outlineColor;
    slide.AddShape(shape);

    The add shape example builds and colors a shape, the add slide how-to creates slides to place them on, and the manage slide how-to arranges the slides that hold them.

    Constructors

    Shape()

    Declaration
    public Shape()

    Properties

    FillColor

    Declaration
    public IColor FillColor { get; set; }
    Property Value
    Type Description
    IColor

    Id

    Declaration
    public uint Id { get; set; }
    Property Value
    Type Description
    System.UInt32

    Name

    Declaration
    public string Name { get; set; }
    Property Value
    Type Description
    System.String

    OutlineColor

    Declaration
    public IColor OutlineColor { get; set; }
    Property Value
    Type Description
    IColor

    Type

    Declaration
    public Nullable<ShapeType> Type { get; set; }
    Property Value
    Type Description
    System.Nullable<ShapeType>

    Methods

    Clone()

    Declaration
    public override IContentElement Clone()
    Returns
    Type Description
    IContentElement
    Overrides
    ParentElement.Clone()

    Implements

    ICloneableElement
    IParentElement
    IShape
    IGraphic
    IContentElement

    Inherited members

    Resize(Int32, Int32)
    Rotate(Double)
    FlipHorizontal()
    FlipVertical()
    Height
    Position
    Width
    Angle
    AddChild(IContentElement[])
    InsertChildToIndex(Int32, IContentElement[])
    Remove()
    RemoveChildren(IContentElement[])
    RemoveAllChildren()
    ExtractElements<T>()
    GetChildByIndex<T>(Int32)
    CloneElement<T>(T)
    LogObjectTree()
    Children
    _Index
    Replace(IContentElement)
    GetIndex()
    CloneObject<T>(T)
    CaptureInitialValues()
    Index
    Parent
    Status
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet