小程序創(chuàng)建 canvas 的繪圖上下文CanvasContext 對(duì)象wx.createCanvasContext
CanvasContext wx.createCanvasContext(string canvasId, Object this)
創(chuàng)建 canvas 的繪圖上下文 CanvasContext 對(duì)象
從基礎(chǔ)庫(kù) 2.9.0 開始,本接口停止維護(hù),請(qǐng)使用 Canvas 代替
小程序插件:支持,需要小程序基礎(chǔ)庫(kù)版本不低于 1.9.6
微信 Windows 版:支持
微信 Mac 版:支持
參數(shù)
string canvasId
要獲取上下文的 canvas 組件 canvas-id 屬性
Object this
在自定義組件下,當(dāng)前組件實(shí)例的this,表示在這個(gè)自定義組件下查找擁有 canvas-id 的 canvas ,如果省略則不在任何自定義組件內(nèi)查找
返回值
CanvasContext
作者:大學(xué)生新聞網(wǎng) 來源:大學(xué)生新聞網(wǎng)
發(fā)布時(shí)間:2025-04-11 閱讀: