Rotate in Android
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7490277/android-rotate-dial">Android - Rotate Dial</a><br>
  <a href="http://stackoverflow.com/questions/7491579/android-rotate-image-around-center-point">Android - Rotate image around center point?</a>  </p>
</blockquote>



<p>How can I rotate a bitmap (not a view or canvas) around its center point when the user touches it and drags it?</p>

<p>I have tried loads of examples on stack overflow and none appear to work.</p>

<p>So far I have:</p>

<pre><code>double r = Math.atan2(posX - dial.getWidth() / 2, dial.getHeight() / 2 - posY);
rotation = (int) Math.toDegrees(r);
</code></pre>
