Check if Canvas is blank in Fabric.js

杀马特。学长 韩版系。学妹 提交于 2019-12-12 00:36:16

问题


I want to check every 5 seconds if my Canvas element is blank.

I followed the solution from the link below, but its not working.

how-to-check-if-a-canvas-is-blank

The above link works for plain canvas element BUT NOT for the one that fabric.js creates.

Here is the Fiddle that works without Fabric.js

Here is my Fiddle that DOES NOT WORK when Fabric.js creates the canvas.


回答1:


it is because you have given background color as white, if you remove that it works



来源:https://stackoverflow.com/questions/36660743/check-if-canvas-is-blank-in-fabric-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!