API Reference
@univerjs
@univerjs/engine-render
classes
Hitcanvas

@univerjs/engine-render v0.4.2Docs


Class: HitCanvas

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

Extends

Constructors

new HitCanvas()

new HitCanvas(props): HitCanvas

Parameters

ParameterType
propsICanvasProps

Returns

HitCanvas

Overrides

Canvas.constructor

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:215 (opens in a new tab)

Properties

PropertyTypeDefault valueInherited fromDefined in
hitCanvasbooleantrue-submodules/univer/packages/engine-render/src/canvas.ts:213 (opens in a new tab)
isCachebooleanfalseCanvas.isCachesubmodules/univer/packages/engine-render/src/canvas.ts:57 (opens in a new tab)

Methods

clear()

clear(): void

Returns

void

Inherited from

Canvas.clear

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:174 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Inherited from

Canvas.dispose

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:167 (opens in a new tab)


getCanvasEle()

getCanvasEle(): HTMLCanvasElement

Returns

HTMLCanvasElement

Inherited from

Canvas.getCanvasEle

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:105 (opens in a new tab)


getContext()

getContext(): UniverRenderingContext

get canvas context

Returns

UniverRenderingContext

context

Method

Inherited from

Canvas.getContext

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:114 (opens in a new tab)


getHeight()

getHeight(): number

Returns

number

Inherited from

Canvas.getHeight

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:126 (opens in a new tab)


getPixelRatio()

getPixelRatio(): number

Returns

number

Inherited from

Canvas.getPixelRatio

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:118 (opens in a new tab)


getWidth()

getWidth(): number

Returns

number

Inherited from

Canvas.getWidth

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:122 (opens in a new tab)


setId()

setId(id): void

Parameters

ParameterType
idstring

Returns

void

Inherited from

Canvas.setId

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:130 (opens in a new tab)


setPixelRatio()

setPixelRatio(pixelRatio): void

Parameters

ParameterType
pixelRationumber

Returns

void

Inherited from

Canvas.setPixelRatio

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:157 (opens in a new tab)


setSize()

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

Parameters

ParameterType
width?number
height?number
pixelRatioParam?number

Returns

void

Inherited from

Canvas.setSize

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

ParameterTypeDescription
mimeTypestring-
qualitynumberbetween 0 and 1 for jpg mime types

Returns

string

data url string

Method

Inherited from

Canvas.toDataURL

Defined in

submodules/univer/packages/engine-render/src/canvas.ts:186 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.