OffscreenCanvas

@native @JSGlobal @JSType
class OffscreenCanvas(var width: Double, var height: Double) extends Object

The OffscreenCanvas interface provides a canvas that can be rendered off screen. It is available in both the window and worker contexts.

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

def convertToBlob(options: ConvertToBlobOptions): Promise[Blob]

Creates a Blob object representing the image contained in the canvas.

Creates a Blob object representing the image contained in the canvas.

def getContext(contextType: String): Dynamic

Returns a rendering context for the offscreen canvas.

Returns a rendering context for the offscreen canvas.

def getContext(contextType: String, contextAttributes: WebGLContextAttributes): Dynamic
def getContext(contextType: String, contextAttributes: TwoDContextAttributes): Dynamic

Creates an ImageBitmap object from the most recently rendered image of the OffscreenCanvas.

Creates an ImageBitmap object from the most recently rendered image of the OffscreenCanvas.

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object

Concrete fields

var height: Double
var width: Double