@univerjs/engine-render v0.5.4


Class: SceneCanvas

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:205

View Renderer constructor. It is a wrapper around native canvas element. Usually you don’t need to use it manually.

Param

Param

Param

Param

Extends

Constructors

new SceneCanvas()

new SceneCanvas(props): SceneCanvas

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:206

Parameters

ParameterType
propsICanvasProps

Returns

SceneCanvas

Overrides

Canvas.constructor

Properties

PropertyTypeDefault valueInherited fromDefined in
isCachebooleanfalseCanvas.isCachepackages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:57

Methods

clear()

clear(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:174

Returns

void

Inherited from

Canvas.clear


dispose()

dispose(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:167

Returns

void

Inherited from

Canvas.dispose


getCanvasEle()

getCanvasEle(): HTMLCanvasElement

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:101

Returns

HTMLCanvasElement

Inherited from

Canvas.getCanvasEle


getContext()

getContext(): UniverRenderingContext

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:110

get canvas context

Returns

UniverRenderingContext

context

Method

Inherited from

Canvas.getContext


getHeight()

getHeight(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:122

Returns

number

Inherited from

Canvas.getHeight


getPixelRatio()

getPixelRatio(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:114

Returns

number

Inherited from

Canvas.getPixelRatio


getWidth()

getWidth(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:118

Returns

number

Inherited from

Canvas.getWidth


setId()

setId(id): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:126

Parameters

ParameterType
idstring

Returns

void

Inherited from

Canvas.setId


setPixelRatio()

setPixelRatio(pixelRatio): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:157

Parameters

ParameterType
pixelRationumber

Returns

void

Inherited from

Canvas.setPixelRatio


setSize()

setSize(
   width?, 
   height?, 
   devicePixelRatio?): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:136

Resize canvas when width or height or devicePixelRatio changed.

Parameters

ParameterType
width?number
height?number
devicePixelRatio?number

Returns

void

Inherited from

Canvas.setSize


toDataURL()

toDataURL(mimeType, quality): string

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:186

to data url

Parameters

ParameterTypeDescription
mimeTypestring-
qualitynumberbetween 0 and 1 for jpg mime types

Returns

string

data url string

Method

Inherited from

Canvas.toDataURL