Class MotionPath
Represents a motion path — a sequence of MotionCmdPath
commands that describe the trajectory along which a shape moves
during an animation.
Maps to the p:path element within p:animMotion in
the OOXML timing model.
Assembly: DRIT.Presentation.dll
Syntax
public class MotionPath : IMotionPath, IEnumerable<IMotionCmdPath>, IEnumerable
Constructors
MotionPath()
Declaration
MotionPath(IEnumerable<MotionCmdPath>)
Initializes a new MotionPath with the specified
commands.
Declaration
public MotionPath(IEnumerable<MotionCmdPath> commands)
Parameters
Properties
Count
Gets the number of commands in the path.
Declaration
public int Count { get; }
Property Value
this[int]
Gets the command at the specified index.
Declaration
public MotionCmdPath this[int index] { get; }
Parameters
| Type |
Name |
Description |
| int |
index |
|
Property Value
Methods
Add(MotionCmdPath)
Adds the specified command to the path.
Declaration
public void Add(MotionCmdPath command)
Parameters
Clear()
Removes all commands from the path.
Declaration
Close()
Adds a CloseLoop command to the path, closing the
current sub-path back to its starting point.
Declaration
public MotionCmdPath Close()
Returns
CurveTo(PointF, PointF, PointF, bool)
Adds a CurveTo command (cubic Bézier) to the path.
The three points are control1, control2, and endpoint.
Declaration
public MotionCmdPath CurveTo(PointF control1, PointF control2, PointF endPoint, bool isRelative = false)
Parameters
Returns
End()
Adds an End command to the path, terminating the path.
Declaration
public MotionCmdPath End()
Returns
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<IMotionCmdPath> GetEnumerator()
Returns
Insert(int, MotionCmdPath)
Inserts a command at the specified index.
Declaration
public void Insert(int index, MotionCmdPath command)
Parameters
LineTo(PointF, bool)
Adds a LineTo command to the path.
Declaration
public MotionCmdPath LineTo(PointF point, bool isRelative = false)
Parameters
| Type |
Name |
Description |
| PointF |
point |
|
| bool |
isRelative |
|
Returns
LineTo(float, float, bool)
Adds a LineTo command with explicit x/y coordinates.
Declaration
public MotionCmdPath LineTo(float x, float y, bool isRelative = false)
Parameters
Returns
MoveTo(PointF, bool)
Adds a MoveTo command to the path.
Declaration
public MotionCmdPath MoveTo(PointF point, bool isRelative = false)
Parameters
| Type |
Name |
Description |
| PointF |
point |
|
| bool |
isRelative |
|
Returns
MoveTo(float, float, bool)
Adds a MoveTo command with explicit x/y coordinates.
Declaration
public MotionCmdPath MoveTo(float x, float y, bool isRelative = false)
Parameters
Returns
Remove(MotionCmdPath)
Removes the specified command.
Declaration
public bool Remove(MotionCmdPath command)
Parameters
Returns
RemoveAt(int)
Removes the command at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
Implements