@univerjs/engine-render v0.4.2 • Docs
Class: Canvas
View Renderer constructor. It is a wrapper around native canvas element. Usually you don't need to use it manually.
Abstract
Param
Param
Param
Param
Extended by
Constructors
new Canvas()
new Canvas(props?): Canvas
Parameters
Parameter | Type |
---|---|
props ? | ICanvasProps |
Returns
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:69 (opens in a new tab)
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
isCache | boolean | false | submodules/univer/packages/engine-render/src/canvas.ts:57 (opens in a new tab) |
Methods
clear()
clear(): void
Returns
void
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:174 (opens in a new tab)
dispose()
dispose(): void
Returns
void
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:167 (opens in a new tab)
getCanvasEle()
getCanvasEle(): HTMLCanvasElement
Returns
HTMLCanvasElement
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:105 (opens in a new tab)
getContext()
getContext(): UniverRenderingContext
get canvas context
Returns
context
Method
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:114 (opens in a new tab)
getHeight()
getHeight(): number
Returns
number
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:126 (opens in a new tab)
getPixelRatio()
getPixelRatio(): number
Returns
number
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:118 (opens in a new tab)
getWidth()
getWidth(): number
Returns
number
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:122 (opens in a new tab)
setId()
setId(id): void
Parameters
Parameter | Type |
---|---|
id | string |
Returns
void
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:130 (opens in a new tab)
setPixelRatio()
setPixelRatio(pixelRatio): void
Parameters
Parameter | Type |
---|---|
pixelRatio | number |
Returns
void
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:157 (opens in a new tab)
setSize()
setSize(
width?,
height?,
pixelRatioParam?): void
Parameters
Parameter | Type |
---|---|
width ? | number |
height ? | number |
pixelRatioParam ? | number |
Returns
void
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:134 (opens in a new tab)
toDataURL()
toDataURL(mimeType, quality): string
to data url
Parameters
Parameter | Type | Description |
---|---|---|
mimeType | string | - |
quality | number | between 0 and 1 for jpg mime types |
Returns
string
data url string
Method
Defined in
submodules/univer/packages/engine-render/src/canvas.ts:186 (opens in a new tab)