这个问题还没解决啊,我也碰到同样的问题
新的canvas的drawImage不支持本地tmp路径的临时文件吗?【貌似官方修复了这个问题。现在可以了。】 https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html drawImage( )不支持本地tmp路径的临时文件,谨慎使用,太坑了。 写法1. ``` path = 'tmp/wxf65e9ae5f68283d2.o6zAJs5h4IkyHaGS7_j6gUPGTR9c.arwyj04Eq2ok341457e272957e237fa21d743912f60b.jpg' ctx.drawImage(path, 0, 0, width, height, 0, 0, canvasWidth, canvasHeight) ``` 提示:Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or SVGImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)';at SelectorQuery callback function 写法2. ``` const img = canvas.createImage() img.src = path img.onload = () =>{ ctx.drawImage(img, 0, 0, width, height, 0, 0, canvasWidth, canvasHeight) } ``` 提示:tmp/wxf65e9ae5f68283d2.o6zAJs5h4IkyHaGS7_j6gUPGTR9c.arwyj04Eq2ok341457e272957e237fa21d743912f60b.jpg:1 GET http://tmp/wxf65e9ae5f68283d2.o6zAJs5h4IkyHaGS7_j6gUPGTR9c.arwyj04Eq2ok341457e272957e237fa21d743912f60b.jpg net::ERR_PROXY_CONNECTION_FAILED
2020-05-22