Table of Contents

Class AniWriterOptions

Namespace
Egami.Formats.Ani
Assembly
Egami.dll

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

Gets the artist to write, or null (the default) for Artist of a raster loaded from ANI.

public string? Artist { get; init; }

Property Value

string

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

IReadOnlyList<int>

Default

Gets the default options.

public static AniWriterOptions Default { get; }

Property Value

AniWriterOptions

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

IcoEntryEncoding?

Filter

Gets the filter that resizes the frames to Sizes, as for Resize. Defaults to Bicubic.

public ResampleFilter Filter { get; init; }

Property Value

ResampleFilter

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

Point?

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

IReadOnlyList<int>

Exceptions

ArgumentOutOfRangeException

A size is outside 1 to 256.

ArgumentException

The list is empty or names a size twice.

Title

Gets the title to write, or null (the default) for Title of a raster loaded from ANI.

public string? Title { get; init; }

Property Value

string