@univerjs/engine-render v0.5.4


Class: abstract Canvas

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

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

Param

Param

Param

Param

Extended by

Constructors

new Canvas()

new Canvas(props?): Canvas

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

Parameters

ParameterType
props?ICanvasProps

Returns

Canvas

Properties

PropertyTypeDefault valueDefined in
isCachebooleanfalsepackages/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


dispose()

dispose(): void

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

Returns

void


getCanvasEle()

getCanvasEle(): HTMLCanvasElement

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

Returns

HTMLCanvasElement


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


getHeight()

getHeight(): number

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

Returns

number


getPixelRatio()

getPixelRatio(): number

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

Returns

number


getWidth()

getWidth(): number

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

Returns

number


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


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


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


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