Use fillText in the WeChat applet drawing API to draw filled text on the canvas


fillText


Definition

Draws filled text on the canvas.

Parameters

QQ截图20170208145634.png

Example

const ctx = wx.createCanvasContext('myCanvas')

ctx.setFontSize(20)
ctx.fillText('Hello', 20, 20)
ctx.fillText('MINA', 100, 100)

ctx.draw()

201612261753034020.png