const canvas = wx.createCanvas();
const ctx = canvas.getContext("2d");
const image = wx.createImage();
export class Main {
constructor() {
image.onload = () => {
ctx.drawImage(
image,
0,
0,
image.width,
image.height,
0,
0,
canvas.width,
canvas.height,
);
};
image.src = "res/bg.png";
}
}
1 回答
- 1 回答
- 0 关注
- 574 浏览
添加回答
举报
0/150
提交
取消