Top position in pixels or as a percentage string (e.g. '50%'). Default: 0.
Left position in pixels or as a percentage string (e.g. '50%'). Default: 0.
Horizontal pixel offset. Default: 0.
Vertical pixel offset. Default: 0.
Fit mode. 'contain' scales the image to fit within the available area (default).
'cover' scales to fill the available area, cropping overflow.
'none' disables scaling and draws at the original bitmap size.
Default: 'contain'.
Preserve the image aspect ratio when fitting. Default: true.
Resampling used when the bitmap is scaled.
Defaults to false (nearest-neighbour) because every pixel of a layer becomes one
dot on the DMD: a smoothed downscale turns edges into intermediate values, which
the dot grid renders as washed-out half-lit dots. Nearest-neighbour keeps each dot
decisively on or off, which is what reads as "sharp" on a dot display.
Pass true (or an explicit 'low' | 'medium' | 'high' quality) to get the browser's
smoothed resampling instead — occasionally what you want for a photographic image on
a high-resolution DMD, where there are enough dots for the gradients to pay off.
Default: false.
Optional widthTarget width in pixels or as a percentage string (used when fit is 'none').
Optional heightTarget height in pixels or as a percentage string (used when fit is 'none').
Optional hHorizontal alignment.
Optional vVertical alignment.
Optional marginMargin on all sides in pixels or as a percentage string. Default: 0.
Optional marginTop margin, overrides margin.
Optional marginRight/end margin, overrides margin.
Optional marginBottom margin, overrides margin.
Optional marginLeft/start margin, overrides margin.
Options for the CanvasLayer.drawBitmap method. Required properties are initialised with defaults inside
drawBitmap.