新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)小程序教程:微信小程序API繪圖stroke(對當(dāng)前路徑進行描邊)
繪圖接口和方法

目前成都創(chuàng)新互聯(lián)已為上千余家的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬主機、網(wǎng)站托管、企業(yè)網(wǎng)站設(shè)計、同安網(wǎng)站維護等服務(wù),公司將堅持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。
canvasContext.stroke
定義
畫出當(dāng)前路徑的邊框。默認(rèn)顏色色為黑色。
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()
const ctx = wx.createCanvasContext('myCanvas')
// begin path
ctx.rect(10, 10, 100, 30)
ctx.setStrokeStyle('yellow')
ctx.stroke()
// begin another path
ctx.beginPath()
ctx.rect(10, 40, 100, 30)
// only stoke this rect, not in current path
ctx.setStrokeStyle('blue')
ctx.strokeRect(10, 70, 100, 30)
ctx.rect(10, 100, 100, 30)
// it will stroke current path
ctx.setStrokeStyle('red')
ctx.stroke()
ctx.draw()
繪圖接口和方法
文章題目:創(chuàng)新互聯(lián)小程序教程:微信小程序API繪圖stroke(對當(dāng)前路徑進行描邊)
文章鏈接:http://m.5511xx.com/article/ccodpce.html


咨詢
建站咨詢
