K
K
kirillleogky2019-11-16 21:22:01
JavaScript
kirillleogky, 2019-11-16 21:22:01

How to draw on a canvas with an image?

There is a code: https://jsfiddle.net/3ab9vc0L/
When you click on the 256x256 button, an image is drawn on the canvas Tell me
how to make it possible to draw with a pencil (drawing occurs when you click the mouse) over the image?
Example:
5dd03da330583302306158.png
How the pencil works - when you click on the canvas with the mouse, the photo now disappears and the default background appears and a pixel with a new color is already drawn there (the color is visible in the Current Color button)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question