canvas.drawImage为什么画出来的不是完整图片?

发布于 6 年前作者 mengping3579 次浏览最后编辑 6 年前来自 issues
wx.getImageInfo({
      src:currentImgSrc,
      success:imgres=>{
        let imgHeight = imgres.height;
        let imgWidth = imgres.width;
        wx.createSelectorQuery()
          .select("#output-canvas")
          .context(function (res) {
            var ctx = res.context;
            ctx.clearRect(0, 0, imgWidth, imgHeight);
            ctx.drawImage(imgres.path, 0, 0, imgWidth, imgHeight,0, 0, imgWidth, imgHeight);
            //这里画出来的是一半的图片 为什么?
          })
          .exec();
0 回复
暂无回复