HTML5 Drawing Board is possible to create with a Javascript Library named Literally Canvas. Like deviantArt, you can add a custom hand drawing field. Practically, this is the project, which is used in deviantArt Muro, but we are giving you a very easy example with Literally Canvas for creation of your own HTML5 Drawing Board. Please visit this App Page named Drawing Canvas (Our Facebook App in testing phase) for screenshots (Heroku Cloud can throw error in the App, its free not much to complain) and deviantArt Muro for extreme example. HTML5 Drawing Board can be created by only embedding few Javascripts – one need not to custom build the parts.
HTML5 Drawing Board With Javascript : The Coding Part
Version will not match with our example, but you might get more features :
1 | https://github.com/literallycanvas/literallycanvas |
We have nothing to hide unlike other bloggers – we always fully show the source code. Never ever use closed source sofwares offered by any blogger or website – does not matter how bigger the person is. The usage data frankly will be stolen and sold. Everyone knows these privacy issues now. Literally Canvas is intended to live inside your application in the way that works best for you. It does not take over your screen. It intentionally do not gobble up events. It tries to keep its UI to a minimum. So, you can defer the script loading. If you want to save, you need to do a bit work :
---
1 2 3 4 | var ctx = $('canvas').get(0).getContext('2d'); ctx.fillStyle = 'rgb(255,255,0)'; ctx.fillRect(0, 0, 300, 300); $('.literally').literallycanvas({preserveCanvasContents: true}); |
false
makes it to set to unsaved.
Practically, you will need to create an HTML5 webpage and include the js and div classes. If you want to give an export option :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <div class="literally export"><canvas></canvas></div> <form class="export"> <input type="submit" data-action="export-as-png" value="Export as PNG"> </form> <script> $(document).ready(function() { $('.literally.export').literallycanvas({ backgroundColor: 'whiteSmoke', imageURLPrefix: '/_static/lib/img', onInit: function(lc) { $('[data-action=export-as-png]').click(function(e) { e.preventDefault(); window.open(lc.canvasForExport().toDataURL()); }) } }); }); </script> |
This will give you a browser based button, you can change the appearance via CSS3.
HTML5 Drawing Board With Javascript : Deployment Part
You can literally deploy it to any HTML5 webpage or within application or part of application. deviantArt comment is an example.
Tagged With how to add a drawing board to html , how to draw board in javascript , Java scripts draw ing board , javascript drawing board , onInit: function(lc)