私の問題はこれです:
NinePatchを使用して作成された再スケーリングされたビットマップを作成する必要があります。
私の現在のシステムは、NinePatchファイルからビットマップを作成します。次に、これはNinePatch(またはNinePatchDrawable)に送られます。次に、サイズを変更して別のビットマップに出力する必要があります。
私はこれをレビューしました、そしてそれはかなり役に立ちました。
これが私の現在のコードです:
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();
}