亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Dokumentation zur WeChat-Applet-Entwicklung / 微信小程序API 繪圖stroke(對當前路徑進行描邊)

微信小程序API 繪圖stroke(對當前路徑進行描邊)

stroke


定義

畫出當前路徑的邊框。默認顏色色為黑色。

Tip: stroke() 描繪的的路徑是從 beginPath() 開始計算,但是不會將 strokeRect() 包含進去,詳情見例二。

例子

const ctx = wx.createCanvasContext('myCanvas')
ctx.moveTo(10, 10)
ctx.lineTo(100, 10)
ctx.lineTo(100, 100)
ctx.stroke()
ctx.draw()

201612241604041624.png

const ctx = wx.createCanvasContext('myCanvas')// begin pathctx.rect(10, 10, 100, 30)
ctx.setStrokeStyle('yellow')
ctx.stroke()// begin another pathctx.beginPath()
ctx.rect(10, 40, 100, 30)// only stoke this rect, not in current pathctx.setStrokeStyle('blue')
ctx.strokeRect(10, 70, 100, 30)

ctx.rect(10, 100, 100, 30)// it will stroke current pathctx.setStrokeStyle('red')
ctx.stroke()
ctx.draw()

201612241604111480.png