Search Results for

    Show / Hide Table of Contents

    Class ElementPosition

    Inheritance
    System.Object
    ElementPosition
    Implements
    IElementPosition
    Namespace: IronPPT.Models
    Assembly: IronPPT.dll
    Syntax
    public class ElementPosition : Object, IElementPosition

    When a shape, image, or text box needs to sit at a precise spot on a slide, ElementPosition holds that location. It pairs a horizontal and a vertical coordinate so a single object describes where an element's anchor lands on the page.

    X and Y are the two coordinates, each an IDocUnit so a position can be expressed in the measurement a project prefers rather than a bare number. Assign an ElementPosition to the element you are placing, and the slide draws it at those coordinates. For brevity, the type also defines an implicit conversion from a (double, double) tuple, so a position can be written as a coordinate pair and the runtime builds the ElementPosition for you. Set X and Y directly when you want explicit units, or assign a tuple when plain numbers are enough. Because position travels with the element it locates, configure it as part of adding and arranging that element. The slide element workflow shows where placement fits in building a slide.

    using IronPPT.Models;
    
    ElementPosition position = (100.0, 50.0);

    The slide element tutorial walks through placing elements on a slide, and the add shape example positions a shape.

    Constructors

    ElementPosition()

    Declaration
    public ElementPosition()

    Properties

    X

    Declaration
    public IDocUnit X { get; set; }
    Property Value
    Type Description
    IDocUnit

    Y

    Declaration
    public IDocUnit Y { get; set; }
    Property Value
    Type Description
    IDocUnit

    Operators

    Implicit((Double, Double) to ElementPosition)

    Declaration
    public static implicit operator ElementPosition((double, double) values)
    Parameters
    Type Name Description
    System.ValueTuple<System.Double, System.Double> values
    Returns
    Type Description
    ElementPosition

    Implements

    IElementPosition
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet