How to detect if html5 canvas is blank?

后端 未结 1 395
梦如初夏
梦如初夏 2021-01-25 05:32

I have a doodle application that saves an html5 canvas to an image in s3. I want to avoid saving blank (totally transparent) pngs if the user accidentally clicks \"save\" witho

相关标签:
1条回答
  • 2021-01-25 06:16

    Can you easily detect clicks/draws? If so, you could have an initial 'canvas empty' boolean that gets flipped the first time the user draws anything.

    Unfortunately, this wouldn't help if the user draws something, then erases it, then saves.

    0 讨论(0)
提交回复
热议问题