-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcanvas圆形.html
86 lines (81 loc) · 1.71 KB
/
canvas圆形.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<canvas id="can" width="800" height="600" ></canvas>
</body>
<script type="text/javascript">
var can=document.getElementById("can");
var tx=can.getContext("2d");
// tx.fillStyle="#ff0000";
// tx.arc(400,200,200,0,Math.PI*2,true);
// tx.stroke();
// tx.beginPath();
//
// tx.arc(320,120,50,0,(Math.PI/180)*180,true);
// tx.stroke();
// tx.beginPath();
//
// tx.arc(460,120,50,0,(Math.PI/180)*180,true);
// tx.stroke();
// tx.beginPath();
//
// tx.arc(400,300,50,0,(Math.PI/180)*180,false);
//
// tx.fill();
//
// tx.beginPath();
//
// tx.arc(400,3,50,0,(Math.PI/180)*30,false);
// tx.fillStyle="#000000";
// tx.stroke();
// tx.beginPath();
//
// tx.arc(350,3,50,0,(Math.PI/180)*60,false);
// tx.fillStyle="#000000";
// tx.stroke();
// tx.beginPath();
//
// tx.arc(300,3,50,0,(Math.PI/180)*60,false);
// tx.fillStyle="#000000";
// tx.stroke();
// tx.beginPath();
// tx.fillText("",300,200,500);
//
//
// tx.fillStyle='#ff0000';
// var i=1;
// timer=setInterval(function(){
// i++;
// if(i>20){
// clearInterval(timer);
// i=1;
// }
// tx.beginPath();
// tx.arc(i*35,i*15,i*5,0,Math.PI*2,true);
// tx.closePath();
// var a=Math.random();
// a=parseInt(a*255);
// tx.fillStyle="rgba("+a+",255,0,0.5)";
// tx.fill();
// tx.strokeStyle
//
// },1000);
//
// tx.beginPath();
//
// tx.translate(0,100);
// tx.font="150px 黑体";
// tx.fillText("lininn",100,100);
// tx.direction="rtl";
// tx.stroke();
var img1=new Image();
img1.src="img/2.jpg";
img1.onload=function(){
tx.drawImage(img1,20,20,900,300);
}
</script>
</html>