문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top