新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
創(chuàng)新互聯(lián)小程序教程:微信小程序API繪圖closePath(關(guān)閉一個(gè)路徑)
繪圖接口和方法

為東山等地區(qū)用戶提供了全套網(wǎng)頁(yè)設(shè)計(jì)制作服務(wù),及東山網(wǎng)站建設(shè)行業(yè)解決方案。主營(yíng)業(yè)務(wù)為成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)、東山網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠(chéng)的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會(huì)得到認(rèn)可,從而選擇與我們長(zhǎng)期合作。這樣,我們也可以走得更遠(yuǎn)!
canvasContext.closePath
定義
關(guān)閉一個(gè)路徑
Tip: 關(guān)閉路徑會(huì)連接起點(diǎn)和終點(diǎn)。
Tip: 如果關(guān)閉路徑后沒(méi)有調(diào)用fill()或者stroke()并開(kāi)啟了新的路徑,那之前的路徑將不會(huì)被渲染。
例子
const ctx = wx.createCanvasContext('myCanvas')
ctx.moveTo(10, 10)
ctx.lineTo(100, 10)
ctx.lineTo(100, 100)
ctx.closePath()
ctx.stroke()
ctx.draw()
const ctx = wx.createCanvasContext('myCanvas')
// begin path
ctx.rect(10, 10, 100, 30)
ctx.closePath()
// begin another path
ctx.beginPath()
ctx.rect(10, 40, 100, 30)
// only fill this rect, not in current path
ctx.setFillStyle('blue')
ctx.fillRect(10, 70, 100, 30)
ctx.rect(10, 100, 100, 30)
// it will fill current path
ctx.setFillStyle('red')
ctx.fill()
ctx.draw()
繪圖接口和方法
網(wǎng)站欄目:創(chuàng)新互聯(lián)小程序教程:微信小程序API繪圖closePath(關(guān)閉一個(gè)路徑)
路徑分享:http://m.fisionsoft.com.cn/article/djjgoci.html


咨詢
建站咨詢
