roundrect-ref.html (274B)
1 <!DOCTYPE html> 2 <html> 3 <body> 4 <canvas id ="output" width="300" height="400"></canvas> 5 <script> 6 var canvas = document.getElementById('output'); 7 var ctx = canvas.getContext('2d'); 8 9 ctx.beginPath(); 10 ctx.roundRect(10, 10, 100, 100, [20]); 11 ctx.fill(); 12 </script> 13 </body> 14 </html>