W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
對(duì)當(dāng)前坐標(biāo)系的原點(diǎn)(0, 0)進(jìn)行變換,默認(rèn)的坐標(biāo)系原點(diǎn)為頁(yè)面左上角。
參數(shù) | 類型 | 說明 |
---|---|---|
x | Number | 水平坐標(biāo)平移量 |
y | Number | 豎直坐標(biāo)平移量 |
const ctx = wx.createCanvasContext('myCanvas')
ctx.strokeRect(10, 10, 150, 100)
ctx.translate(20, 20)
ctx.strokeRect(10, 10, 150, 100)
ctx.translate(20, 20)
ctx.strokeRect(10, 10, 150, 100)
ctx.draw()
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: