Malisa Huzaifa - Web Multimedia HTML6 Canvas & SVG

95 <html> <head> <title>HTML5 Canvas</title> <style> body{ background-color: ivory; } #canvas{border:1px solid red; } </style> </head> <body> <h4>Menggambar Dengan Canvas</h4> <canvas id="canvas" width=512 height=400></canvas> </body> <script> const canvas = document.getElementById("canvas"); let context = canvas.getContext("2d"); context.fillStyle = "white"; context.fillRect(0, 0, canvas.width, canvas.height); let draw_color= "black"; let draw_width= "2"; let is_drawing= false; canvas.addEventListener("touchstart", start, false); canvas.addEventListener("touchmove", draw, false); canvas.addEventListener("mousedown", start, false);

RkJQdWJsaXNoZXIy MTM3NDc5MQ==