收藏
回答

canvas画布绘制位置,真机和工具发生偏移,该怎么办?

var textCanvas = res[0].node; // 重点1
                          var textCtx = textCanvas.getContext("2d"); // 重点\
                          that.setData({
                            printC: res[0].node,
                          });
                          // 获取设备设备像素比
                          const dpr = wx.getSystemInfoSync().pixelRatio;


                          textCanvas.width = res[0].width * dpr;
                          textCanvas.height = res[0].height * dpr;

textCtx.fillText(
                              that.data.drugData.drug_name,
                              220,
                              240
                            );

最后一次编辑于  2022-08-23
回答关注问题邀请回答
收藏
登录 后发表内容