title: Scale bitmap to specific size, keeping aspect ratio and filling the rest with 0 alpha pixels
body: <p>I've been searching for a solution to this problem for quite some time and haven't found anything to match my needs yet.</p>
  
  <p>I want to scale a bitmap to a specific size while maintaining aspect ratio.
  Think of it as scaling a bitmap using fitCenter in an ImageView, only in a new bitmap.</p>
  
  <p>The source bitmap has to fit inside the destination bitmap which has a specific size, and the rest of the pixels have to be transparent.</p>
  
  <p>I have tried using Glide like so:</p>
  
  <pre><code>Glide.with(context).load(url)
                              .asBitmap()
                              .override(1280, 720)
                              .fitCenter()
                              .into(1280, 720)
                              .get();
  </code></pre>
  
  <p>But this method returns a bitmap that fits only width (or hight) and wraps the size.</p>
  
  <p>I've heard that using Canvas is a possible solution but haven't found any way of achieving my goal using it.</p>
  
  <p>Any help or insight would be greatly appreciated. I will post any needed clarifications if requested.</p>