代码:

 1 /**
 2  * Created by Administrator on 2016/1/28.
 3  */
 4 function draw (id){
 5     var canvas = document.getElementById(id);
 6     var context = canvas.getContext("2d");
 7     context.beginPath();
 8     context.moveTo(100,180);
 9     context.lineTo(200,50);
10     context.lineTo(300,200);
11     context.strokeStyle = "rgba(0,0,0,0.4)"
12     context.lineWidth = 2;
13     context.stroke();
14 //  绘制辅助线
15     context.beginPath();
16     context.moveTo(80,120);
17 //    context.arcTo(150,60,180,130,50);
18 //    context.quadraticCurveTo(200,50,300,200);
19 //    context.bezierCurveTo(110,80,260,100,300,200);
20     context.lineWidth = 3;
21     context.strokeStyle = "rgba(255,135,0,1)";
22     context.stroke();
23 }
View Code

相关文章:

  • 2021-11-04
  • 2022-01-28
  • 2021-09-16
  • 2021-05-22
  • 2021-12-06
  • 2022-12-23
  • 2021-09-19
猜你喜欢
  • 2022-01-11
  • 2022-02-24
  • 2022-03-04
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-10-08
相关资源
相似解决方案