Posts Tagged ‘Canvas’

check canvas empty or not <“canvas11″ height=”200px” width=”200px”> <asp:Button runat=”server” ID=”btn1″ Text=”Save” OnClientClick=”checkcanvas();” /> <script type=”text/javascript”> function checkcanvas() { var i = isCanvasTransparent(); //i =true if canvas empty //i =false if canvas has image } function isCanvasTransparent() { var canvas1 = document.getElementById(‘canvas11’); // true if all pixels Alpha equals to zero var ctx = canvas1.getContext(“2d”); […]