@mbtech-nl/bitmap / stackBitmaps
Function: stackBitmaps()
ts
function stackBitmaps(bitmaps: readonly LabelBitmap[], direction: "horizontal" | "vertical"): LabelBitmap;Defined in: transform.ts:245
Concatenate bitmaps horizontally or vertically.
Horizontal stacking requires every input to share the same heightPx; vertical stacking requires every input to share the same widthPx.
Parameters
| Parameter | Type | Description |
|---|---|---|
bitmaps | readonly LabelBitmap[] | At least one bitmap to stack. |
direction | "horizontal" | "vertical" | 'horizontal' (left-to-right) or 'vertical' (top-to-bottom). |
Returns
A new bitmap containing the stacked input.
Throws
If the input is empty or dimensions don't align.
Example
ts
const labelTop = stackBitmaps([logo, title], 'horizontal');
const fullLabel = stackBitmaps([labelTop, body], 'vertical');