After I read Image, I want to use canvas's drawImage.
but id does not work. when I call onload,
TypeError: a.onload is not a function
it happened.
what's wrong?
let ctx = new Image();
ctx.onload(() => {
this.compositedImage.drawImage(ctx, 0, 0, ctx.width, ctx.height, 0, 0, is.compositedCanvas.width, this.compositedCanvas.height);
resolver(this);
}, this);
it is written in a Promise context, so is it related to this?
Please help me....
ctx.onload = () => {} or better use addEventListener like this ctx.addEventListener('load', () => {})