title: Bitmap to NinePatch to New Scaled Bitmap
body: <p>My problem is this:</p>
  
  <p>I need to create a re-scaled bitmap created using a NinePatch.</p>
  
  <p>My current system creates a Bitmap from a NinePatch file. This then gets fed into a NinePatch (or NinePatchDrawable). I then need to resize it and output to another Bitmap.</p>
  
  <p>I have reviewed <a href="https://stackoverflow.com/questions/5079868/create-a-ninepatch-ninepatchdrawable-in-runtime">this</a> and it helped quite a bit.</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>try {
          Bitmap bitmap1 = BitmapFactory.decodeStream(getAssets().open("gfx/head.9.png"));
  
          // Using NinePatch?
          NinePatch patch = new NinePatch(bitmap1, bitmap1.getNinePatchChunk(), null);
          // Or NinePatchDrawable?
          NinePatchDrawable patch = new NinePatchDrawable(bitmap1, bitmap1.getNinePatchChunk(), new Rect(), null);
  
          // Set dimensions from NinePatch and create new bitmap
          // Bitmap bitmap2 = ?
  }
  catch (IOException e) {
          e.printStackTrace();
  }
  </code></pre>