PngHelper

Ecng.Drawing

Reads what a PNG picture states about itself in its header, without decoding the picture.

メソッド

GetPngSize
public static Size GetPngSize(ReadOnlySpan<byte> data)
result = PngHelper.GetPngSize(data)

Reads the size of a PNG picture off its header.

data
The picture, or as much of its beginning as holds the header.

戻り値: The size of the picture, in pixels.

GetPngSize
public static Size GetPngSize(byte[] data)
result = PngHelper.GetPngSize(data)

Reads the size of a PNG picture off its header.

data
The picture, or as much of its beginning as holds the header.

戻り値: The size of the picture, in pixels.

IsPng
public static bool IsPng(ReadOnlySpan<byte> data)
result = PngHelper.IsPng(data)

Determines whether the data is a PNG picture, by the signature every PNG picture starts with.

data
The data.

戻り値: if the data starts with the PNG signature.

IsPng
public static bool IsPng(byte[] data)
result = PngHelper.IsPng(data)

Determines whether the data is a PNG picture, by the signature every PNG picture starts with.

data
The data.

戻り値: if the data starts with the PNG signature.

TryGetPngSize
public static bool TryGetPngSize(ReadOnlySpan<byte> data, Size size)
result = PngHelper.TryGetPngSize(data, size)

Reads the size of a PNG picture off its header.

data
The picture, or as much of its beginning as holds the header.
size
The size of the picture, in pixels.

戻り値: if the PNG header is missing or its length or dimensions are invalid.

TryGetPngSize
public static bool TryGetPngSize(byte[] data, Size size)
result = PngHelper.TryGetPngSize(data, size)

Reads the size of a PNG picture off its header.

data
The picture, or as much of its beginning as holds the header.
size
The size of the picture, in pixels.

戻り値: if the PNG header is missing or its length or dimensions are invalid.