title: Android rotate bitmap around center without resizing
body: <p>I'm struggling to draw a rotating bitmap around its center and do the rotating without resizing the bitmap. I'm drawing all my sprites to the screen via a game thread, so I'm looking for a solution that incorporates the original bitmap and not the canvas.</p>
  
  <p>Thanks in advance.</p>
  
  <p>This is my code so far, it turns a bitmap around its center, yet resizes it.</p>
  
  <pre><code>i = i + 2;
              transform.postRotate(i, Assets.scoresScreen_LevelStar.getWidth()/2, Assets.scoresScreen_LevelStar.getHeight()/2);
              Bitmap resizedBitmap = Bitmap.createBitmap(Assets.scoresScreen_LevelStar, 0, 0, Assets.scoresScreen_LevelStar.getWidth(), Assets.scoresScreen_LevelStar.getHeight(), transform, true);
  
              game.getGraphics().getCanvasGameScreen().drawBitmap(resizedBitmap, null, this.levelStar.getHolderPolygons().get(0), null);
  </code></pre>
  
  <p><strong>Update:</strong> </p>
  
  <p>I've noticed this isn't as easy as it sounds. My rotating code is not the problem. The bitmap rotates, yet the dst rect will also have to increase/decrease depending on the angle of rotation, or else the bimap will appear smaller, since it's drawn into a fixed dst rect.
  So I'm guessing I'll have to develop some method that will return a dst rect.
  <em>So the methods needed to rotate a bitmap without appeared resizing:</em></p>
  
  <pre><code>public static Bitmap rotateBitmap(Bitmap bitmap, int rotation) // I've got this method working
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public static Rect rotateRect(Rect currentDst, int rotation) // Don't got this
  </code></pre>
  
  <p>I understand this will require some math (trig), anyone up for the challenge? :P</p>