微信小程式開發(fā)文檔
/ 在微信小程序中調(diào)用scale方法對橫縱坐標進行縮放
在微信小程序中調(diào)用scale方法對橫縱坐標進行縮放
scale
定義
在調(diào)用scale
方法后,之后創(chuàng)建的路徑其橫縱坐標會被縮放。多次調(diào)用scale
,倍數(shù)會相乘。
參數(shù)
例子
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()