0

So I'm trying to do the following using Chrome on the local computer (not on a server).

var timg = ctx1.getImageData(0,0,1920,1080);
y=0;
b=1;
clickImgChange();

var clickImgChange = function()
{
    y=y+a;
    b=b+1;
    ctx1.putImageData(timg,0,y);
    if(y<1080)
        requestAnimationFrame(clickImgChange);
}

and I get the following:

Uncaught TypeError: Failed to execute 'putImageData' on 'CanvasRenderingContext2D': The provided double value is non-finite.

The canvas is 1920x1080 in size, and then shrunk to fit using CSS (width:100%;). The drawImage that I've done is using an image from the local folder. Chrome has been started using google-chrome --allow-file-access-from-files index.html.

Edward
  • 495
  • 1
  • 6
  • 20

0 Answers0