Javascript examples for Canvas:Draw
hand draw on canvas with JavaScript?
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.4.0/fabric.min.js"></script> <style id="compiled-css" type="text/css"> #sheet-container {//ww w . j a v a 2 s . com width: 400px; height: 400px; border: 1px solid black; } </style> <script type="text/javascript"> window.onload=function(){ var canvas = new fabric.Canvas('sheet'); canvas.isDrawingMode = true; canvas.freeDrawingBrush.width = 1; canvas.freeDrawingBrush.color = "#ff0000"; console.log(canvas); } </script> </head> <body> <div id="sheet-container"> <canvas id="sheet" width="400" height="400"></canvas> </div> </body> </html>