var canvas = document.getElementById('canvas'); canvas.width = 100; canvas.height = 100; if (canvas.getContext) { var ctx = canvas.getContext('2d'); var coinImage = new Image(); coinImage.onload = function() { ctx.drawImage(coinImage, 0, 0, 100, 100, 0, 0, 100, 100); }; coinImage.src = "img/1.png"; }
Dostaję błąd
Kod
IndexSizeError: Index or size is negative or greater than the allowed amount
O co chodzi?