@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
Parameter | Type |
---|---|
props ? | ICanvasProps |
Returns
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
isCache | boolean | false | packages/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
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
Parameter | Type |
---|---|
id | string |
Returns
void
setPixelRatio()
setPixelRatio(pixelRatio): void
Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/canvas.ts:157
Parameters
Parameter | Type |
---|---|
pixelRatio | number |
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
Parameter | Type |
---|---|
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
Parameter | Type | Description |
---|---|---|
mimeType | string | - |
quality | number | between 0 and 1 for jpg mime types |
Returns
string
data url string