Class ElementPosition
Inheritance
System.Object
ElementPosition
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
Properties
X
Declaration
public IDocUnit X { get; set; }
Property Value
Y
Declaration
public IDocUnit Y { get; set; }
Property Value
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
Implements