title: Scaling canvas and keeping center
body: <p>I'm want to scale a canvas with a bitmap drawn on it. I'm able to scale the canvas but the bitmap drawn on it moves to the upper left respectively lower right.</p>
  
  <pre><code>@Override
  protected void onDraw(Canvas canvas) {
      canvas.translate(mPosX, mPosY);
      canvas.scale(mScaleFactor, mScaleFactor);
  
      //draw bitmap
  }
  </code></pre>
  
  <p>For the last few days I tried many different approaches from manipulating translation coordinates to pivot points for scaling. But nothing did work for me. I'm pretty sure there must be an easy solution for my problem.</p>
  
  <p>Thanks in advance </p>