How to get background color of SVG converted properly into Canvas

前端 未结 3 1716
迷失自我
迷失自我 2020-12-21 10:38

Im converting a d3 svg object with use of canvg library to an canvas and display it as an image (png).

The resulting image has a transparent background, which is not

3条回答
  •  暖寄归人
    2020-12-21 11:22

    I'd "draw" the background in the svg with a rect:

    
    
    
      
      
      
    
    
    
      

提交回复
热议问题