Node / Canvas · reference
Canvas size and coordinates
Reference the width, height, x, and y sizing and coordinate behavior used by Apexify.js createCanvas.
| Surface | Available | Notes |
|---|---|---|
| width | Yes | Explicit output width in pixels |
| height | Yes | Explicit output height in pixels |
| x | Yes | Coordinate offset; normally zero |
| y | Yes | Coordinate offset; normally zero |
| customBg.inherit | Yes | May derive missing dimensions from the loaded image |
| videoBg.inherit | Yes | When true, adopts dimensions from the extracted still frame |
Width and height
Implicit sizing
Omit dimensions and rely on the 500 × 500 fallback.
Production sizing
Set explicit dimensions when output size is part of the contract.
The grouped fragments above compare sizing policy only; they are not separate executable examples. The canonical runnable source remains the stable DOC-5 example linked from the canvas overview.
If both dimensions remain unset and neither image background opts into inherit: true, the creator defaults to 500 × 500.
When can another source determine size?
customBg.inherit: truecan take width and height from the loaded image.videoBg.inherit: trueextracts the selected still frame once and adopts that frame's width and height.
Coordinates
| Feature | Default | Purpose |
|---|---|---|
| x | 0 | Horizontal offset used by rotation/layout math |
| y | 0 | Vertical offset used by rotation/layout math |
Before
After
Installation reference
Minimal valid example
Explicit 640 × 360 output
The resulting PNG surface is 640 pixels wide and 360 pixels high unless a different documented configuration path intentionally changes the effective size.
Next steps
Return to the Canvas and createCanvas overview for validation, return-value, background, and paint-pipeline context.