Programmer
Programmer

Reputation: 6753

Annotate image on canvas with text

I have a canvas with an image on it. When the user clicks on the canvas , I can find the x and y coordinates of the click. Now, i want to open a text box where the user can type something and write the result on top of the image. any ideas?

Upvotes: 2

Views: 1680

Answers (1)

George
George

Reputation: 4257

There are a couple ways I can think of doing this. Probably the simplest would be moving a temporary text input (<input type="text" />) over the canvas, having the user type in that, and then when they are done, write the text to the canvas with fillText(). I would personally keep the text in the input fields for as long as possible, so that the user can go back and edit the fields.

Upvotes: 1

Related Questions