Class AniFormat
The Windows animated cursor format (.ani), registered in Default: a RIFF file whose frames are cursors or icons, with a display time and an order for each step. Load returns one animated raster with a frame per step, all at one size; LoadAll returns the animation once for every size its frames hold. Save writes an animated raster with AniWriterOptions.
public static class AniFormat
- Inheritance
-
AniFormat
- Inherited Members
Examples
// One frame per step of the animation, all at one size: the largest, as for an icon.
using Raster<Rgba8> busy = Raster.Load<Rgba8>("busy.ani");
foreach (Frame<Rgba8> frame in busy.Frames)
{
Point? hotspot = ((IcoDetails)frame.Metadata.FormatDetails!).Hotspot;
Console.WriteLine($"{frame.Metadata.Delay.TotalMilliseconds:F0} ms, hotspot {hotspot}");
}
// MinimumSize picks the smallest size at least that big; LoadAll gives the animation at every size, largest first.
using Raster<Rgba8> small = Raster.Load<Rgba8>("busy.ani", options: new ReaderOptions { MinimumSize = new Size(32, 32) });
using RasterList sizes = Raster.LoadAll("busy.ani");
Properties
Info
Gets the format's registration: name, MIME type, extension, signature, reader and writer.
public static FormatInfo Info { get; }