Table of Contents

Class PngFormat

Namespace
Egami.Formats.Png
Assembly
Egami.dll

The PNG format, registered in Default.

public static class PngFormat
Inheritance
PngFormat
Inherited Members

Examples

// Every built-in format, with its name, extensions and MIME types; Raster.Save picks one by extension.
foreach (FormatInfo format in new[] { PngFormat.Info, JpegFormat.Info, GifFormat.Info, BmpFormat.Info, TgaFormat.Info, QoiFormat.Info, PnmFormat.Info })
{
    Console.WriteLine($"{format.Name}: {string.Join(", ", format.Extensions)} ({string.Join(", ", format.MimeTypes)})");
}

// A SignatureMatcher decides from the first SignatureLength bytes whether a file is in the format.
SignatureMatcher isPng = PngFormat.Info.Matches;
bool png = isPng(File.ReadAllBytes("duck.png").AsSpan(0, PngFormat.Info.SignatureLength));

Properties

Info

Gets the format's registration: name, MIME type, extension, signature, reader and writer.

public static FormatInfo Info { get; }

Property Value

FormatInfo