WeChat アプレット開発ドキュメント
/ 在微信小程序中調用scale方法對橫縱坐標進行縮放
在微信小程序中調用scale方法對橫縱坐標進行縮放
scale
定義
在調用scale
方法后,之后創(chuàng)建的路徑其橫縱坐標會被縮放。多次調用scale
,倍數會相乘。
參數
例子
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()