Why does my canvas go blank after converting to image?

前端 未结 3 702
温柔的废话
温柔的废话 2020-12-01 09:48

I am trying to convert the canvas element on this page to a png using the following snippet (e.g. enter in JavaScript console):

(function conver         


        
3条回答
  •  没有蜡笔的小新
    2020-12-01 10:21

    Here's some things to try. I don't know whether either of these should be necessary to make this work, but they might make a difference.

    • Add preserveDrawingBuffer: true to the getContext attributes.
    • Try doing this with a later tutorial which does animation; i.e. draws on the canvas repeatedly rather than just once.

提交回复
热议问题