提交 16d5a2a6 编写于 作者: H hdx

canvas-context: drawImage 调整为绝对路径

上级 b5896ef7
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
const context = this.renderingContext! const context = this.renderingContext!
const image = this.canvasContext!.createImage() const image = this.canvasContext!.createImage()
image.src = '../../../static/api.png'; image.src = '/static/api.png';
image.onload = () => { image.onload = () => {
context.save() context.save()
this.clearCanvasRect() this.clearCanvasRect()
...@@ -603,7 +603,7 @@ ...@@ -603,7 +603,7 @@
drawImageLocal() { drawImageLocal() {
const context = this.renderingContext! const context = this.renderingContext!
const image = this.canvasContext!.createImage(); const image = this.canvasContext!.createImage();
image.src = '../../../static/uni.png' image.src = '/static/uni.png'
image.onload = () => { image.onload = () => {
context.drawImage(image, 0, 0, 100, 100) context.drawImage(image, 0, 0, 100, 100)
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册