//创建画布 ctx.fillStyle = '#fff' ctx.fillRect(0, 0, this.config.maxWidth, this.config.maxHeight) //获取宽度 var txt='今天天气很好' var wid_1 = ctx.measureText(txt).width console.log(wid_1, 'wid_1') //打印 144 "wid_1"
京公网安备 11010502049817号