canvas drawimage在开发工具上会在所有图形中绘制
canvas drawimage在开发工具上会在所有图形中绘制
在真机中符合效果
代码
this .cav = wx.createCanvasContext( "cav" , this ); let ctx = this .cav; let self = this ; // this.drawBg('blue', rpx(320), rpx(240)); ctx.rect(0, 0, rpx(120), rpx(40)) ctx.setFillStyle( 'yellow' ) ctx.fill(); ctx.restore(); self.cav.save(); self.cav.beginPath(); self.cav.arc(70, 70, 25, 0, 2*Math.PI); self.cav.clip(); await this .drawImage( `https: //mp.weixin.qq.com/debug/wxadoc/dev/image/cat/0.jpg?t=2018614`, rpx(160), rpx(120)); this .cav.draw(); |