My problem is this:
I need to create a re-scaled bitmap created using a NinePatch.
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.
I have reviewed this and it helped quite a bit.
Here is my current 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();
}