VectSharp 2.6.1
A light library for C# vector graphics
Loading...
Searching...
No Matches
VectSharp.Animation Class Reference

Describes an animation constituted by a number of frames and transitions between them. More...

Public Member Functions

 Animation (double width, double height, double linearisationResolution)
 Creates a new Animation with the specified width, height and linearisation resolution. More...
 
Page GetFrameAtAbsolute (double time)
 Obtains the (interpolated) frame that should be displayed after the specified time has passed since the start of the animation. More...
 
Page GetFrameAtRelative (double relativeTime)
 Obtains the (interpolated) frame that should be displayed after the specified relative time has passed since the start of the animation. More...
 
void AddFrame (Frame frame, Transition transition=null)
 Adds a new frame to the animation, with the specified transition. More...
 
void RemoveLastFrame ()
 Removes the last frame from the animation (and the corresponding transition). More...
 

Properties

ImmutableList< FrameFrames = ImmutableList<Frame>.Empty [get]
 The key frames of the animation. More...
 
ImmutableList< TransitionTransitions = ImmutableList<Transition>.Empty [get]
 The transitions between successive frames of the animation. This array always contains one fewer element than Frames. More...
 
double Width [get, set]
 The width of the animation. More...
 
double Height [get, set]
 The height of the animation. More...
 
Colour Background = Colour.FromRgba(255, 255, 255, 0) [get, set]
 The background colour of the animation. More...
 
double LinearisationResolution [get]
 The absolute length between successive samples to use when linearising GraphicsPaths. More...
 
double Duration = 0 [get]
 The total duration of the animation (not including the number of repeats). More...
 
int RepeatCount = 0 [get, set]
 The number of times that the animation should repeat. More...
 

Detailed Description

Describes an animation constituted by a number of frames and transitions between them.

Definition at line 1410 of file Animation.cs.

Constructor & Destructor Documentation

◆ Animation()

VectSharp.Animation.Animation ( double  width,
double  height,
double  linearisationResolution 
)

Creates a new Animation with the specified width, height and linearisation resolution.

Parameters
widthThe width of the animation.
heightThe height of the animation.
linearisationResolutionThe absolute length between successive samples to use when linearising GraphicsPaths.

Definition at line 1461 of file Animation.cs.

Member Function Documentation

◆ AddFrame()

void VectSharp.Animation.AddFrame ( Frame  frame,
Transition  transition = null 
)

Adds a new frame to the animation, with the specified transition.

Parameters
frameThe new frame to add to the animation.
transitionThe transition that should be applied between the previous frame and the new frame. This parameter is ignored for the first frame. If this is null, the animation will abruptly change from one frame to the next.

Definition at line 1586 of file Animation.cs.

◆ GetFrameAtAbsolute()

Page VectSharp.Animation.GetFrameAtAbsolute ( double  time)

Obtains the (interpolated) frame that should be displayed after the specified time has passed since the start of the animation.

Parameters
timeThe time since the start of the animation (in milliseconds).
Returns
A Page containing the interpolated frame that should be displayed after the specified time has passed since the start of the animation.

Definition at line 1473 of file Animation.cs.

◆ GetFrameAtRelative()

Page VectSharp.Animation.GetFrameAtRelative ( double  relativeTime)

Obtains the (interpolated) frame that should be displayed after the specified relative time has passed since the start of the animation.

Parameters
relativeTimeThe time since the start of the animation (ranging from 0 for the start of the animation, to 1 for the end of the animation).
Returns
A Page containing the interpolated frame that should be displayed after the specified time has passed since the start of the animation.

Definition at line 1576 of file Animation.cs.

◆ RemoveLastFrame()

void VectSharp.Animation.RemoveLastFrame ( )

Removes the last frame from the animation (and the corresponding transition).

Exceptions
ArgumentOutOfRangeExceptionThrown if there are no frames in the animation.

Definition at line 1608 of file Animation.cs.

Property Documentation

◆ Background

Colour VectSharp.Animation.Background = Colour.FromRgba(255, 255, 255, 0)
getset

The background colour of the animation.

Definition at line 1438 of file Animation.cs.

◆ Duration

double VectSharp.Animation.Duration = 0
get

The total duration of the animation (not including the number of repeats).

Definition at line 1448 of file Animation.cs.

◆ Frames

ImmutableList<Frame> VectSharp.Animation.Frames = ImmutableList<Frame>.Empty
get

The key frames of the animation.

Definition at line 1415 of file Animation.cs.

◆ Height

double VectSharp.Animation.Height
getset

The height of the animation.

Definition at line 1433 of file Animation.cs.

◆ LinearisationResolution

double VectSharp.Animation.LinearisationResolution
get

The absolute length between successive samples to use when linearising GraphicsPaths.

Definition at line 1443 of file Animation.cs.

◆ RepeatCount

int VectSharp.Animation.RepeatCount = 0
getset

The number of times that the animation should repeat.

Definition at line 1453 of file Animation.cs.

◆ Transitions

ImmutableList<Transition> VectSharp.Animation.Transitions = ImmutableList<Transition>.Empty
get

The transitions between successive frames of the animation. This array always contains one fewer element than Frames.

Definition at line 1420 of file Animation.cs.

◆ Width

double VectSharp.Animation.Width
getset

The width of the animation.

Definition at line 1428 of file Animation.cs.


The documentation for this class was generated from the following file: