I am looking for the same amount of images on a canvas when I enter values at input
.
This is what I have:
var distancia, aux = 0;
for (var i = 0; i <arrText.length; i++) {
parseFloat(arrText[i]);
distancia = (arrText[i] + aux) / escala;
aux = aux + arrText[i];
var disxd = (aux - 250) / escala;
var image = $('.screem');
ctx.drawImage(image, 80 + disxd, 67);
}
But I get the following error.
Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The provided value is not of type '(CSSImageValue or HTMLImageElement or HTMLVideoElement or HTMLCanvasElement or ImageBitmap or OffscreenCanvas)' at HTMLButtonElement.<anonymous> (<anonymous>:1700:11) at HTMLButtonElement.dispatch (<anonymous>:3:10315) at HTMLButtonElement.q.handle (<anonymous>:3:8342)