Answer the question
In order to leave comments, you need to log in
How to insert an image into canvas?
Please tell me if it is possible to insert an arbitrary image instead of points, indicating the path to it. And if possible, tell me where to dig.
Example:
codepen.io/acauamontiel/pen/mJdnw
Answer the question
In order to leave comments, you need to log in
I decided
var img = new Image(); // Создаём новый объект Image
img.src = 'imgcss/wide.png'; // Устанавливаем путь к источнику
context.drawImage(img, this.x, this.y, 50, 26); //рисуем картинку в канвас
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question