HTML5 Canvas Text Edit

前端 未结 3 1987
谎友^
谎友^ 2021-01-13 17:18

I have a text filled in HTML5 canvas using fillText(); How to make it editable and read the value into a variable? The text must be inside canvas, as it will

3条回答
  •  逝去的感伤
    2021-01-13 17:59

    Once the text is drawn to the canvas, it becomes pixels. The original text (and the polygon outline) will not be stored. You can't get it back from the canvas like you can't get it from jpg or png file.

    If the canvas is drawn by your JavaScript, you can store the text in some other place. If not, you have to OCR it.

提交回复
热议问题