<canvas canvas-id="canvas" style="width: 100%; height: 750rpx;"></canvas>
const ctx = uni.createCanvasContext('canvas')
const url = '/static/logo.png'
ctx.setFillStyle('#007AFF')
uni.getImageInfo({
src:url,
success(res) {
console.log('res', res)
ctx.save()
const pattern = ctx.createPattern(res.path, 'repeat-x')
ctx.setFillStyle(pattern)
// ctx.fillStyle = pattern
ctx.fillRect(0, 0, 300, 150)
ctx.restore()
ctx.draw()
}
})
4 个回复
DCloud_UNI_Anne
问题已记录,已加分,感谢您的反馈!
DCloud_UNI_LXH
预计下版带上
傑丶 - wjj
果然不是我一个人遇到,渲染出来一片黑!!!
DCloud_UNI_GSQ
HBuilderX alpha 3.2.5+ 已修复