提交 ff2b317b 编写于 作者: H hdx

canvas-context: 适配微信drawImage

上级 d458ee4f
......@@ -371,7 +371,7 @@
pattern() {
const context = this.renderingContext!
const image = new Image(100, 100)
const image = this.canvasContext!.createImage()
image.src = '../../../static/api.png';
image.onload = () => {
context.save()
......@@ -556,7 +556,7 @@
context.fillText("Circle!", 265, 100)
// context.reset()
hidpi(uni.getElementById("canvas") as UniCanvasElement)
hidpi(this.canvas!)
},
translate() {
const context = this.renderingContext!
......@@ -602,7 +602,7 @@
},
drawImageLocal() {
const context = this.renderingContext!
const image = new Image(100, 100)
const image = this.canvasContext!.createImage();
image.src = '../../../static/uni.png'
image.onload = () => {
context.drawImage(image, 0, 0, 100, 100)
......@@ -610,7 +610,7 @@
},
drawImage() {
const context = this.renderingContext!
const image = new Image(100, 100);
const image = this.canvasContext!.createImage();
image.src = 'https://web-ext-storage.dcloud.net.cn/uni-app-x/hello-uniappx-qrcode.png'
image.onload = () => {
context.drawImage(image, 0, 0, 100, 100)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册