Skip to content

@mbtech-nl/bitmap / createBitmap

Function: createBitmap() ​

ts
function createBitmap(widthPx: number, heightPx: number): LabelBitmap;

Defined in: encode.ts:81

Allocate an empty (all-white) bitmap.

Parameters ​

ParameterTypeDescription
widthPxnumberWidth in pixels (positive integer).
heightPxnumberHeight in pixels (positive integer).

Returns ​

LabelBitmap

A bitmap with data zero-filled.

Throws ​

If either dimension is not a positive integer.

Example ​

ts
const blank = createBitmap(384, 64);

Released under the MIT License.