title: HTML5 Canvas Rotate Image
body: <pre><code>jQuery('#carregar').click(function() {
    var canvas    = document.getElementById('canvas');
    var image   = document.getElementById('image');
    var element = canvas.getContext(&quot;2d&quot;);
    element.clearRect(0, 0, canvas.width, canvas.height);
    element.drawImage(image, 0, 0, 300, 300);
  });
  </code></pre>
  <p><a href="http://jsfiddle.net/braziel/nWyDE/" rel="noreferrer">jsfiddle.net/braziel/nWyDE/</a></p>
  <p>I have a problem to rotate an image 90 ° to the right or to the left.</p>
  <p>I use an image on the canvas, the same screen will have several canvas equal to that of the example, but I left it as close as possible to the project.</p>
  <p>I ask, how do I rotate the image 90 ° to the left or right when I click &quot;Rotate Left&quot; and &quot;Rotate Right&quot;?</p>
  <p>I tried several codes on the internet but none worked.</p>