const renderItem = () => { const canvas = wx.createCanvasContext('yourCanvasId'); const img = user.idPhoto?.sourceUrl; const imgWidth = imgWidth * oldScale; // 考虑缩放后的宽度 const imgHeight = imgHeight * oldScale; // 考虑缩放后的高度 const sx = 0; const sy = 0; const sWidth = imgWidth; const sHeight = imgHeight; const dx = oldX; const dy = oldY; const dWidth = imgWidth; const dHeight = imgHeight; canvas.drawImage(img, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight); canvas.draw(); };