title: Modified size of canvas HTML5 on the fly
body: <p>I am creating an applicattion to make mindmaps in Canvas and now i have problems with the resize of elements. Initially i have this:</p>
  
  <pre><code>&lt;div id="lienzo"&gt;
  
              &lt;canvas id="canvas2" width="1000" height="1000"&gt;
  
                  This text is displayed if your browser does not support HTML5 Canvas.
  
              &lt;/canvas&gt;
  
          &lt;/div&gt;
  </code></pre>
  
  <p>But any time i want to change the size of the canvas,ie change the width and height of the element canvas.</p>
  
  <p>I have tried remove the canvas with:</p>
  
  <pre><code>$('canvas').remove();
  </code></pre>
  
  <p>And later create a new element canvas with:</p>
  
  <pre><code>$("&lt;canvas/&gt;",{id:'canvas2'}).appendTo('#lienzo'); 
  $('canvas').width(500);
  $('canvas').height(500);
  </code></pre>
  
  <p>Later i did this i redraw the element in Canvas but this elements look pixelated</p>
  
  <p>Of course, in the new canvas I can´t selected the element.</p>
  
  <p>I tried to change directly measures of Canvas but i have the same problem.</p>
  
  <p>After explaining all, the question is, how could i change the size of Canvas on the fly without that the items in the canvas change. Any idea?</p>
  
  <p>Thanks you for your time</p>