2

I want to add text on an image using HTML5. How can this be done?

1 Answer 1

7

You can load the image into a canvas (using drawImage()), then draw text on the canvas (using fillText()).

If you want to you can then take the image data from the canvas using toDataUrl() and post that data to the server for image persistence.

If you only need it for client side visibility you have a much simpler solution that doesn't use html5. just overlay a text over the image using absolute positioning.

Sign up to request clarification or add additional context in comments.

1 Comment

Vague question, great answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.