-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcanvas-circulos-arcos.html
executable file
·66 lines (37 loc) · 1.09 KB
/
canvas-circulos-arcos.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<canvas id='logotipo' width='120' height='120' style='border:1px solid black' >
tu navegador no soporta canvas
</canvas>
<script type='text/javascript'>
var c=document.getElementById('logotipo');
var cxt =c.getContext("2d");
cxt.fillStyle="blue";
cxt.beginPath(); // empezamos un recorrido sin parametros
cxt.arc(60,60,50,0,Math.PI*2,true); // expresado en radianes 50 hasta pix2
cxt.closePath;
cxt.fill(); // para rellenarlo
cxt.fillStyle="white";
cxt.beginPath(); // empezamos un recorrido sin parametros
cxt.arc(60,60,30,0.75*Math.PI,Math.PI*2,true);
// x y rad de hasta pi*2
cxt.closePath;
cxt.fill();
cxt.fillStyle="white";
cxt.beginPath();
cxt.arc(70,40,10,Math.PI,Math.PI*2,false); // false parte de arriba o parte de abajo en true
cxt.closePath;
cxt.fill();
cxt.fillStyle="white";
cxt.beginPath();
cxt.arc(40,50,10,1.8*Math.PI,0.8*Math.PI,true);
cxt.closePath;
cxt.fill();
</script>
</body>
</html>