执子左
(作者)
drawCanvas() {
uni.showLoading({
title: "loading"
});
var _this = this;
var context = uni.createCanvasContext('playbillCanvas');
context.drawImage(_this.areaImage, 0, 0, uni.upx2px(550), uni.upx2px(750));
context.draw(true);
base64ToPath(_this.qr).then(path => {
context.save();
context.drawImage(path, _this.oldImage.imageX, _this.oldImage.imageY, uni.upx2px(_this.image_size), uni.upx2px(
_this.image_size));
context.restore();
context.draw(true);
}).catch(error => {
console.error(error)
})
context.save();
context.setFontSize(uni.upx2px(_this.textFontSize));
context.setFillStyle(_this.textColor);
context.fillText(_this.message, _this.oldText.textX, _this.oldText.textY+10);