为啥使用canvas绘制完成后会出现黑色边框?
为啥使用canvas绘制完成后会出现黑色边框[图片] 代码: <canvas type="2d" id="canvasChessBoard"></canvas> const query = wx.createSelectorQuery()
query.select('#canvasChessBoard')
.fields({ node: true, size: true })
.exec((res) => {
const canvas = res[0].node
const ctx = canvas.getContext('2d')
// ctx.drawImage(dataTemp.strPathImgChessboard, 0, 0, dataTemp.nCanvChessBoardWidth, dataTemp.nCanvChessBoardHeight)
const dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = res[0].width * dpr
canvas.height = res[0].height * dpr
ctx.scale(dpr, dpr)
ctx.fillRect(0, 0, 100, 100)
})