My problem is this:
I need to create a rescaled bitmap created using NinePatch.
My current system creates a bitmap from a NinePatch file. Then it is served in NinePatch (or NinePatchDrawable). Then I need to resize it and output it to another bitmap.
I looked over this one 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(); }
android bitmap nine-patch
Knossos
source share