Class AniWriterOptions
Options for writing ANI. Each frame of the raster is a step of the animation; a frame that repeats an earlier one (same pixels, same hotspot) is stored once and shown again. Every stored frame is a cursor with the entries IcoWriterOptions would write. Delays are rounded to 1/60 s, and a delay under 20 ms is written as 100 ms, as browsers play GIFs. ANI always loops. EXIF, XMP and IPTC are not written; an ICC profile goes into PNG entries.
public sealed class AniWriterOptions : WriterOptions
- Inheritance
-
AniWriterOptions
- Inherited Members
Examples
// Every frame is a step; frames that repeat are stored once. Each stored frame holds every size Windows may draw.
spin.Save("spin.ani", new AniWriterOptions
{
Sizes = AniWriterOptions.CursorSizes,
Hotspot = new Point(32, 32),
Title = "Spinning duck",
});
Properties
Artist
public string? Artist { get; init; }
Property Value
CursorSizes
Gets the sizes Windows draws cursors at as the display scale grows: 32, 48, 64, 96 and 128.
public static IReadOnlyList<int> CursorSizes { get; }
Property Value
Default
Gets the default options.
public static AniWriterOptions Default { get; }
Property Value
Encoding
Gets how every entry is stored, or null (the default) to choose per entry as Encoding does: PNG at 256 × 256, 32-bit BMP below, a frame loaded from a cursor keeping its entry's encoding at its own size.
public IcoEntryEncoding? Encoding { get; init; }
Property Value
Filter
public ResampleFilter Filter { get; init; }
Property Value
Hotspot
Gets the hotspot of every frame at the raster's own size, scaled to each entry, or null (the default) for each frame's own Hotspot, else the raster's, else the top-left pixel.
public Point? Hotspot { get; init; }
Property Value
Sizes
Gets the square sizes every stored frame holds, 1 to 256, or null (the default) to write the frames at the raster's own size, fitted down to 256 with a warning when larger. A raster that is not square is fitted inside each square and centred on transparency, as Sizes does.
public IReadOnlyList<int>? Sizes { get; init; }
Property Value
Exceptions
- ArgumentOutOfRangeException
A size is outside 1 to 256.
- ArgumentException
The list is empty or names a size twice.
Title
public string? Title { get; init; }