Constructors
constructor
-
Parameters
Properties
createCanvas
createCanvas: any
height
height: any
obniz
obniz: any
width
width: any
Methods
createCanvasContext
- createCanvasContext(width: number, height: number): any
-
Parameters
-
width: number
-
height: number
Returns any
Static dataArray2string
- dataArray2string(data: Uint8Array | number[]): string | null
-
Parameters
-
data: Uint8Array | number[]
Returns string | null
Static string2dataArray
- string2dataArray(str: string): number[]
-
Parameters
Returns number[]
This creates a Canvas context. It will add a canvas dom to body(in html).
// Example const ctx = obniz.util.createCanvasContext(128, 64); ctx.font = "9px sans-serif"; ctx.fillText('Hello', 0, 7);