1. 程式人生 > >html 5

html 5

pre mage nbsp log logs image htm png pat

   var c=$("#myCanvas")[0];
   var context= c.getContext("2d");
   // context.fillStyle="#ff0000";
    context.beginPath();
    context.moveTo(200, c.height/2); //起始點
    context.lineTo(c.width-200, c.height/2); //結束點
    context.lineWidth=20;
    context.strokeStyle="#ff0000";
    context.lineCap="round";
    context.stroke();

技術分享

html 5