title: Resize html5 canvas with shape drawn on cnvas
body: <p>I have drawn shape on html5 canvas with some hardcoded pixels. now I want to resize the drwan shape on resizing the canvas width and height.here is my code:</p>
  
  <pre><code>                      var canvas  = document.getElementById("myCanvas");
            var context = canvas.getContext("2d");
  
                          context.moveTo(232, 158);
                          context.lineTo(314, 145);
                          context.lineTo(382, 134);
                          context.lineTo(491, 144);
                          context.lineTo(576, 154);
                          context.lineTo(512,170);
                          context.quadraticCurveTo(404, 152, 352, 160);
                          context.lineTo(304,168);
                          //context.stroke();
                          context.closePath();
                          context.fillStyle = xx_Lpattern;
                          context.fill();
  
                          context.beginPath();
  
                          context.moveTo(576, 154);
                          context.lineTo(670, 163);
                          context.lineTo(751, 174);
                          context.lineTo(748,236);
                          context.lineTo(606, 216);
                          context.quadraticCurveTo(705, 188, 576, 179);
                          context.lineTo(512,170)
                          //context.stroke();
                          context.closePath();
                          context.fillStyle = xx_Lpattern;
                          context.fill();
  </code></pre>
  
  <p>After resizing canvas size shape size should also get change (here I want to minimize the canvas size to size 500x300) . </p>