I would like to create this kind of drawing tool on the web browser.
I understand that this is done using the canvas tag.
Beforehand, I understood how to draw when the coordinate axis is known (the user does not set the coordinate axis).
I think the following two points are the key points of the drawing tool I want to do this time.
1) Users can draw whatever size they want in the position they want
2) Real-time size changes are visible when changing sizes
However, I am at a loss as to how to implement them.
As for 1) I have a vague understanding of whether I should obtain the coordinate axis of the user and draw a figure based on the starting point and the ending point.
You can also find out how to get coordinates.
However, I didn't know how to do it so that I could see how the size of 2) was changing.
If the drawing method is done after the start and end points are determined, it will be easy to implement, but since the size has changed to real-time?, how
I don't know if I should implement it.
Could someone lend me some wisdom?
You have a page to refer to, so why don't you check the source?
For example, you can see that the following techniques are used to redraw the mouse in real time.
© 2022 OneMinuteCode. All rights reserved.