Skip to content

Class IconImages

Namespace: Apogee.Export
Assembly: Apogee.Export.dll

A game's icon (game.xml's Icon: a square PNG) at the sizes the platforms want: Windows icon resources, the macOS icns, the Linux icon. Sizes below the image are made by averaging the pixels each new pixel covers (a box filter, with transparent pixels counting for nothing in the colors); a size above it is made the same way, which only repeats pixels, and is warned about.

public sealed class IconImages

Inheritance

object ← IconImages

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Fields

AdvisedSize

The width and height an icon should have at least to look right at the largest size the common platforms use for a window or a file list.

public const int AdvisedSize = 256

Field Value

int

Properties

Size

The width and height of the image as it was given.

public int Size { get; }

Property Value

int

Warnings

What is not right about the icon: it is smaller than , or a size had to be made bigger than the image. Grows as sizes are asked for.

public IReadOnlyList<string> Warnings { get; }

Property Value

IReadOnlyList<string>

Methods

Load(byte[])

Decodes a PNG (or any image the importer reads).

public static IconImages Load(byte[] png)

Parameters

png byte[]

Returns

IconImages

Exceptions

ExportException

The file is not an image, or it is not square.

Png(int)

The image at size x size as a PNG file.

public byte[] Png(int size)

Parameters

size int

Returns

byte[]

Rgba(int)

The image at size x size as RGBA8, top row first, not premultiplied.

public byte[] Rgba(int size)

Parameters

size int

Returns

byte[]