Answer the question
In order to leave comments, you need to log in
How to implement zoom by mouse direction?
Here is a piece of code.
var array = [];
for (var a = 1; a < 9; a++) {
for (var i = 1; i < 6; i++) {
var img = new Image();
img.src="***/max/section"+a+"/"+i+".jpg";
array[i] = img;
}
var canvas = document.getElementById('canvas');
var context2D = canvas.getContext('2d');
for (var i = 1; i < array.length; i++) {
array[i].onload = function(n){
context2D.drawImage(array[n],(i-1)*2348,(a-1)*2112,2348,2112);
}(i);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question