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"; } }
慕设计2395807
相关分类