Write text on canvas with background

后端 未结 3 1021
死守一世寂寞
死守一世寂寞 2021-01-03 20:43

Is it possible to write image on canvas and write text with background? For example like this:

\"http://awesomes

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-03 20:57

    I simpler solution is to call fillText twice. First a string of Unicode+2588 █ which is a black rectangle repeated the same length as the text using the background color. And then call fillText as normal with the foreground color.

提交回复
热议问题