Answer the question
In order to leave comments, you need to log in
How to arrange two elements side by side in canvas?
I insert files through input, and they replace each other, but it is necessary that the first one appears first, and on the right, the second
https://jsfiddle.net/Percyvelle/7v9kdjh1/1/
Answer the question
In order to leave comments, you need to log in
Well, calculate the coordinates of the next picture. This is the width of the previous one.
let prevX = 0;
function handleImage(e){
...
ctx.drawImage(img, prevX, 0, 300, 300)
prevX = img.width;
...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question