<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Canvas в HTML5</title>
<script src='OSC.js'></script>
</head>
<body>
<canvas id='test' width='1250px' height='600px'></canvas>
<script>
var c=document.getElementById("test");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.moveTo(20,20); // Create a starting point
ctx.lineTo(100,20); // Create a horizontal line
//arcTo(x1,y1,x2,y2,радиус)
ctx.arcTo(150,20,150,150,50); // Create an arc
ctx.lineTo(150,220); // Continue with vertical line
ctx.lineTo(500,220);
ctx.lineTo(500,50);
ctx.arcTo(500,50,600,20,50);
ctx.stroke(); // Draw it
</script>
</body>
</html> |