- 生成canvas海报图,海报里透明底的小程序码会变黑色。测试版是正常的,只有在正式版才会
const ctx = uni.createCanvasContext('myCanvas'); ctx.clearRect(0,0,that.canvasWidth,that.canvasHeight) // 绘制海报 ctx.drawImage(posterinfo.path, 0, 0, posterinfo.width, posterinfo.height); ctx.save(); // 绘制二维码 var codeWidth = 150; var codeHeight = 150; var codeX = that.canvasWidth - 25 - codeWidth; //二维码x坐标 var codeY = 25; //二维码y坐标 var arcR = codeWidth / 2; ctx.beginPath(); ctx.arc(codeX + arcR, codeY + arcR, arcR, 0, 2 * Math.PI); ctx.setFillStyle('rgba(255,255,255,0.6)'); ctx.fill(); ctx.drawImage(codeinfo.path, codeX, codeY, codeWidth, codeHeight); console.log(posterinfo.path, codeinfo.path); ctx.draw(false,()=>{ uni.canvasToTempFilePath({ canvasId:'myCanvas', x:0, y:0, width:that.canvasWidth, height:that.canvasHeigh, destWidth:that.canvasWidth, destHeight:that.canvasHeight, fileType:'jpg', success(res){ that.canvasImg = res.tempFilePath console.log(res.tempFilePath) resolve(res.tempFilePath) },fail(err) { reject(err) } }) }); [图片]
2020-04-13 - 如何解决保存下来的海报图,小程序码(透明底)是黑色的?
const ctx = uni.createCanvasContext('myCanvas'); ctx.clearRect(0,0,that.canvasWidth,that.canvasHeight) // 绘制海报 ctx.drawImage(posterinfo.path, 0, 0, posterinfo.width, posterinfo.height); ctx.save(); // 绘制二维码 var codeWidth = 150; var codeHeight = 150; var codeX = that.canvasWidth - 25 - codeWidth; //二维码x坐标 var codeY = 25; //二维码y坐标 var arcR = codeWidth / 2; ctx.beginPath(); ctx.arc(codeX + arcR, codeY + arcR, arcR, 0, 2 * Math.PI); ctx.setFillStyle('rgba(255,255,255,0.6)'); ctx.fill(); ctx.drawImage(codeinfo.path, codeX, codeY, codeWidth, codeHeight); [图片]
2020-04-13 - textarea组件bug
- 当前 Bug 的表现(可附上截图) [图片] 在真机上面组件就算z-index比textarea高,但textarea还是能输入
2018-09-06