Animation
Ecng.Drawing
An animation: its canvas, how many times it plays and its frames. The frames are decoded one at a time, as they are asked for, so that a long animation never has all its canvases in memory at once.
Properties
Frames
public IEnumerable<AnimationFrame> Frames { get; }
value = animation.Frames
The frames in order. Enumerating decodes them; each comes as a picture of its own that the caller may change.
Plays
public int Plays { get; }
value = animation.Plays
How many times the animation plays; 0 - endlessly.
Methods
EnsureWithinBudget
public static void EnsureWithinBudget(int frames, long pixels)
Animation.EnsureWithinBudget(frames, pixels)
Refuses an animation that takes more work than the decoders do for one file.
- frames
- Number of frames.
- pixels
- Pixels to decode and composite, all frames together.
Select
public Animation Select(int width, int height, Func<RasterImage, RasterImage> change)
result = animation.Select(width, height, change)
The same animation with every frame replaced by what makes of it.
Fields
MaxFrames
public const int MaxFrames
value = Animation.MaxFrames
The most frames an animation may have to be decoded.
MaxPixels
public const long MaxPixels
value = Animation.MaxPixels
The most pixels an animation may take to decode, all frames together: every frame costs its canvas, whatever part of it the frame itself covers.