WeChat Mini Programs canvas drawImage () picture zooming and moving problem

1. Problem description I asked the user to zoom and move the picture and want to save it. Now can display the zoomed image, and related parameters, but then adjust to the canvas, found that the image position is wrong.
2. Related code
wxml picture display:

<view class="oimg">
    <image src="{{imgUrl}}" class="img"  style="transform:translate({{offsetX}}px, {{offsetY}}px) scale({{scale}});width: {{width}}px; height: {{height}}px; margin-left:-{{width/2}}px;margin-top:-{{height/2}}px"></image>
  </view>

pass the corresponding parameters to canvas

draw() {

    const pc = wx.createCanvasContext("myCanvas");
    pc.clearRect(0, 0, 300, 300);
    pc.translate(this.data.offsetX1 , this.data.offsetY1);
    pc.scale(this.data.scale1, this.data.scale1);
    pc.drawImage(this.bgPic, 0, 0, 300, 300);
 
    pc.draw();
  },

Picture moved by original zooming
clipboard.png

canvas

clipboard.png

look for advice. Thank you

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c33c-40880.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c33c-40880.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?