programming-examples/js/Drawing/Draw a right-angled triangle.js

14 lines
370 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
function draw()
{
var canvas = document.getElementById('canvas');
if (canvas.getContext)
{
var context = canvas.getContext('2d');
context.beginPath();
context.moveTo(75,75);
context.lineTo(10,75);
context.lineTo(10,25);
context.fill();
}
}