This is basically useless :
Based on the source of Froyo , it is used when creating images with nine patches from a resource, but not when creating a regular raster image:
852 private static Drawable drawableFromBitmap(Resources res, Bitmap bm, byte[] np, 853 Rect pad, String srcName) { 854 855 if (np != null) { 856 return new NinePatchDrawable(res, bm, np, pad, srcName); 857 } 858 859 return new BitmapDrawable(res, bm); 860 }
You get there by following the schedule:
createFromStream returns:
return createFromResourceStream(null, null, is, srcName, null);
which, in turn, uses:
return drawableFromBitmap(res, bm, np, pad, srcName);
(np comes from Bitmap#getNinePatchChunk(); ) and this calls:
return new NinePatchDrawable(res, bm, np, pad, srcName);
Finally, you get into the NinePatch ad:
public class NinePatch
Create a stretch projection from a bitmap to nine patches.
Options
bitmap A bitmap describing patches.
chunk A 9-patch data block describing how the underlying bitmap is split and drawn.
srcName The source name for the bitmap. May be null .