How to draw the three triangle in single page using canvas?

后端 未结 3 383
清歌不尽
清歌不尽 2021-01-24 10:58



        
3条回答
  •  时光说笑
    2021-01-24 11:29

    function draw() {
      var canvas = document.getElementById('canvas');
      if (canvas.getContext){
        var ctx = canvas.getContext('2d');
    
        ctx.beginPath();
        ctx.moveTo(75,50);
        ctx.lineTo(100,75);
        ctx.lineTo(100,25);
        ctx.fill();
      }
    }
    
     
       
     
    

    You can reffer following artice-Drawing shapes in canvas.

提交回复
热议问题