Class IcnsEntry
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
TypestringThe entry's four-character type, such as
ic08oril32.WidthintThe width in pixels.
HeightintThe height in pixels.
BitsPerPixelint1, 4, 8, 24 (RGB without a mask) or 32.
EncodingIcnsEntryEncodingHow 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
Encoding
How the pixels are stored.
public IcnsEntryEncoding Encoding { get; init; }
Property Value
Height
The height in pixels.
public int Height { get; init; }
Property Value
Type
The entry's four-character type, such as ic08 or il32.
public string Type { get; init; }
Property Value
Width
The width in pixels.
public int Width { get; init; }