Table of Contents

Class IcnsEntry

Namespace
Egami.Formats.Icns
Assembly
Egami.dll

One image entry of an icon family.

public sealed record IcnsEntry : IEquatable<IcnsEntry>
Inheritance
IcnsEntry
Implements
Inherited Members

Examples

// Probe reads only the elements: how many images an icon family holds, without decoding a pixel.
RasterInfo info = Raster.Probe("app.icns");
Console.WriteLine($"{info.ImageCount} entries; Load gives {info.Width}×{info.Height}");
using Raster best = Raster.Load("app.icns");
foreach (IcnsEntry entry in ((IcnsDetails)best.Metadata.FormatDetails!).Entries)
{
    Console.WriteLine($"{entry.Type}: {entry.Width}×{entry.Height}, {entry.BitsPerPixel} bits, {entry.Encoding}");
}

Constructors

IcnsEntry(string, int, int, int, IcnsEntryEncoding)

One image entry of an icon family.

public IcnsEntry(string Type, int Width, int Height, int BitsPerPixel, IcnsEntryEncoding Encoding)

Parameters

Type string

The entry's four-character type, such as ic08 or il32.

Width int

The width in pixels.

Height int

The height in pixels.

BitsPerPixel int

1, 4, 8, 24 (RGB without a mask) or 32.

Encoding IcnsEntryEncoding

How the pixels are stored.

Examples

// Probe reads only the elements: how many images an icon family holds, without decoding a pixel.
RasterInfo info = Raster.Probe("app.icns");
Console.WriteLine($"{info.ImageCount} entries; Load gives {info.Width}×{info.Height}");
using Raster best = Raster.Load("app.icns");
foreach (IcnsEntry entry in ((IcnsDetails)best.Metadata.FormatDetails!).Entries)
{
    Console.WriteLine($"{entry.Type}: {entry.Width}×{entry.Height}, {entry.BitsPerPixel} bits, {entry.Encoding}");
}

Properties

BitsPerPixel

1, 4, 8, 24 (RGB without a mask) or 32.

public int BitsPerPixel { get; init; }

Property Value

int

Encoding

How the pixels are stored.

public IcnsEntryEncoding Encoding { get; init; }

Property Value

IcnsEntryEncoding

Height

The height in pixels.

public int Height { get; init; }

Property Value

int

Type

The entry's four-character type, such as ic08 or il32.

public string Type { get; init; }

Property Value

string

Width

The width in pixels.

public int Width { get; init; }

Property Value

int