且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JavaScript 无法执行“drawImage"

更新时间:2022-04-06 08:32:35

问题在于我加载图像的方式,我应该这样做:

The problem was the way that I was loading my Images, I should've been doing:

var image = new Image();
image.src = "imagesource.jpg";

但相反,我从 document 页面通过 id 获取元素.

But instead I was get the elements by id from the document page.

资源:

图片加载说明

html如何加载图片的说明