May 19, 2021 WeChat Mini Program Development Document
Drawing interfaces and methods
After the
scale
is called, the horizontal coordinates of the path that is then created are scaled.
Scale is
scale
times, and the multiples are multiplied.
Parameters | Type | Description |
---|---|---|
scaleWidth | Number | Multiply of horizontal coordinate scaling (1 x 100%, 0.5 x 50%, 2 x 200%) |
scaleHeight | Number | Multiply the scale of the ordinate axis (1 s 100%, 0.5 s 50%, 2 s 200%) |
const ctx = wx.createCanvasContext('myCanvas')
ctx.strokeRect(10, 10, 25, 15)
ctx.scale(2, 2)
ctx.strokeRect(10, 10, 25, 15)
ctx.scale(2, 2)
ctx.strokeRect(10, 10, 25, 15)
ctx.draw()