Skip to content

PackImage

Namespace Mc.Scripting.Content · Kind class (static)

public static class PackImage

Small generated textures for packs and tests: 8-bit RGBA PNG files made without any imaging library.

Member Description
static byte[] Checker(uint a, uint b, int size = 16, int cell = 4) A PNG of a two colour checker board.
static byte[] Create(int width, int height, Func<int, int, uint> pixel) A PNG from a pixel function.
static byte[] Solid(uint argb, int size = 16) A PNG of one colour.
public static byte[] Checker(uint a, uint b, int size = 16, int cell = 4)

A PNG of a two colour checker board.

Parameters

Name Type Description
a uint The first colour (0xAARRGGBB).
b uint The second colour.
size int = 16 The width and height in pixels.
cell int = 4 The side of a square in pixels.

Returns byte[]: The PNG file.

public static byte[] Create(int width, int height, Func<int, int, uint> pixel)

A PNG from a pixel function.

Parameters

Name Type Description
width int The width.
height int The height.
pixel Func<int, int, uint> The colour of a pixel (x, y) as 0xAARRGGBB.

Returns byte[]: The PNG file.

public static byte[] Solid(uint argb, int size = 16)

A PNG of one colour.

Parameters

Name Type Description
argb uint The colour as 0xAARRGGBB.
size int = 16 The width and height in pixels.

Returns byte[]: The PNG file.