Node / Images Shapes · guide
createImage basics — source, placement & fit
Current Apexify.js 6.0.0 documentation for createImage basics — source, placement & fit.
Required fields
Every ImageProperties entry must include:
| Field | Type | Notes |
|---|---|---|
source | **`string | Buffer |
x | number | Top-left of the layout box (unless overridden by shape-specific geometry). |
y | number | Same. |
If source, x, or y is missing, ImageCreator throws.
Bitmap sizing — width, height, inherit
After the image loads, the layout box size is:
| Situation | Width / height used |
|---|---|
inherit: true and width omitted | Intrinsic image width |
inherit: true and height omitted | Intrinsic image height |
Otherwise width/height omitted | Also falls back to intrinsic size |
Explicit width/height | Forces box dimensions |
Use inherit when you want “natural” pixels but still allow fit / align inside an explicit box.
Fit & align — how bitmaps land in the box
FitMode is 'fill' | 'contain' | 'cover' — exported from apexify.js alongside AlignMode.
| Mode | Behaviour |
|---|---|
fill | Stretches to exactly width × height |
contain | Uniform scale so the whole image fits inside the box (may letterbox) |
cover | Uniform scale so the box is fully covered (may crop) |
AlignMode covers center, top, bottom, left, right, and corners (top-left, …). align only matters when contain leaves empty margins.
SOURCEtypescript
typescript