Problem in rotating image in android
<p>I am facing problme in rotating image</p>

<p>Following code works fine</p>

<pre><code>Matrix matrix = new Matrix();
matrix.postRotate(DEGREE,mBitmap.getWidth() / 2, mBitmap.getHeight() / 2);
Bitmap m = Bitmap.createBitmap(mBitmap, 0, 0, mBitmap.getWidth(),mBitmap.getHeight(), matrix, true);
canvas.drawBitmap(m, mX, mY, null);
</code></pre>

<p>But I dont want to create a new bitmap again and again so I am using the following code</p>

<pre><code>Matrix matrix = new Matrix();
matrix.postTranslate(mX, mY);
matrix.postRotate(DEGREE,mBitmap.getWidth() / 2, mBitmap.getHeight() / 2);
canvas.drawBitmap(mBitmap, matrix, null);
</code></pre>

<p>In that case image goes out of the view. It is not visible.</p>
