gpt4 book ai didi

javascript - Canva 图像有时不使用 drawImage() 方法显示图像?

转载 作者:行者123 更新时间:2023-11-29 23:01:14 34 4
gpt4 key购买 nike

<分区>

我只想使用 drawImage() 方法在 canva 上绘制图像。但有时图像未绘制。即使我使用 onload 事件,它仍然无法显示图像。在我问我的问题之前,我只想明确图像有时被绘制而不是有时被绘制。那么这个问题的原因是什么,我该如何解决或修复它。

let imagez = new Image();
imagez.src="photo/run.png";
context.drawImage(imagez,10,10,50,60); // it does not draw the image always. why?

I expect the image to be drawn whenever I refresh the page

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com