Table of Contents

Enum IcoEntryEncoding

Namespace
Egami.Formats.Ico
Assembly
Egami.dll

How an icon entry's pixels are stored.

public enum IcoEntryEncoding

Fields

Bmp = 1

A BMP without its file header: the color rows, then a 1-bit AND mask that marks transparent pixels.

Png = 0

A whole PNG file.

Examples

// A favicon: 16, 32 and 48 resized from one raster. A raster that is not square is centred on transparency.
logo.Save("favicon.ico", new IcoWriterOptions { Sizes = IcoWriterOptions.FaviconSizes });

// Windows' set: 16 to 256, the 256 entry as PNG and the rest as 32-bit BMP, as Microsoft's guidance asks.
logo.Save("app.ico", new IcoWriterOptions { Sizes = IcoWriterOptions.WindowsSizes, Filter = Egami.Operations.ResampleFilter.Lanczos3 });

// Hand-drawn small sizes: each raster is written at its own size; the 48 comes from the largest raster.
using Raster<Rgba8> drawn16 = logo.Derive(ops => ops.Fit(16, 16));
Raster.SaveAll([logo, drawn16], "drawn.ico", new IcoWriterOptions { Sizes = [16, 48] });