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

目前成都創(chuàng)新互聯(lián)已為上千余家的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬主機(jī)、網(wǎng)站托管、企業(yè)網(wǎng)站設(shè)計(jì)、同安網(wǎng)站維護(hù)等服務(wù),公司將堅(jiān)持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長(zhǎng),共同發(fā)展。
canvasContext.stroke
定義
畫出當(dāng)前路徑的邊框。默認(rèn)顏色色為黑色。
Tip:stroke()描繪的的路徑是從beginPath()開始計(jì)算,但是不會(huì)將strokeRect()包含進(jìn)去,詳情見例二。
例子
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()
繪圖接口和方法
本文標(biāo)題:創(chuàng)新互聯(lián)小程序教程:微信小程序API繪圖stroke(對(duì)當(dāng)前路徑進(jìn)行描邊)
分享URL:http://www.dlmjj.cn/article/ccodpce.html


咨詢
建站咨詢
