Docs

Bitmap.prototype.scaled

Returns a new Bitmap with the same pixel data but a different scale factor.

Syntax

scaled(n)

Parameters

Return value

A new Bitmap object with the specified scale.

Example

let bitmap = new Bitmap(new Uint8Array([255, 0, 0, 255]), 1, 1)
let scaled = bitmap.scaled(2.0)
scaled.scale
2