title: Expanding the drawing on canvas for android
body: <p>So the scenario is that I have a surfaceView of size 640 x 480 on which I am showing on camera preview. Now I draw a something vertically on the screen. After that I am rotating the canvas using</p>
  
  <pre><code>canvas.rotate(90, getWidth()/2, getHeight/2);
  </code></pre>
  
  <p>Once I do that, I am expecting my drawing to be scaled and drawn horizontally. It does draw it horizontally but it is not scaling it according the width and height. </p>
  
  <p>Here is the pictorial example explanation to help you understand better. 
  <a href="https://lh4.googleusercontent.com/-2wlImCt0m88/UcHzhKUSGBI/AAAAAAAAB9Y/bGNMOTu9DqM/s1440/canvas_rotation.png" rel="nofollow">https://lh4.googleusercontent.com/-2wlImCt0m88/UcHzhKUSGBI/AAAAAAAAB9Y/bGNMOTu9DqM/s1440/canvas_rotation.png</a></p>
  
  <p>Is there a way or an algorithm by which I can rotate the canvas and then scale it accordingly? 
  let me know if you need any further explanation. </p>
  
  <p>Thanks in advance. </p>