CanvasClass

CanvasClass

小程序canvas海报处理

Constructor

new CanvasClass(argCtx, argWidth, argBasicWidth, argScale)

Source:
Parameters:
Name Type Default Description
argCtx object

canvas上下文

argWidth number 300

canvas宽度

argBasicWidth number 375

基准宽度

argScale number 4

canvas缩放比例

Methods

(async) createPoster(argW, argH, argFileType) → {any}

Source:
Parameters:
Name Type Default Description
argW number
argH number
argFileType string jpg
Returns:

返回生成的图片

Type
any

(async) draw(argIsCreate, argW, argH, argFileType) → {any}

Source:
Parameters:
Name Type Default Description
argIsCreate boolean

是否已生成

argW number

是否已生成

argH number

是否已生成

argFileType string jpg

生成的文件类型

Returns:

返回生成的图片

Type
any

drawImage() → {this}

Source:
Returns:

返回class

Type
this

fillText(argText, argX, argY, argMaxWidth, argIsVertical) → {this}

Source:
Parameters:
Name Type Description
argText string
argX number
argY number
argMaxWidth number
argIsVertical number
Returns:

返回class

Type
this

getScale(argData) → {number}

Source:
Parameters:
Name Type Description
argData number
Returns:

返回计算好的值

Type
number