List of usage examples for android.graphics NinePatch NinePatch
public NinePatch(Bitmap bitmap, byte[] chunk, String srcName)
From source file:Main.java
public static NinePatchDrawable createScalableDrawable(Bitmap pic) { NinePatch np = new NinePatch(pic, pic.getNinePatchChunk(), null); return new NinePatchDrawable(np); }
From source file:Main.java
/** return NinePatchDrawable with give id * @param aContext//from w w w.j ava 2 s . c o m * @param aNinePatchResourceId * @return */ public static NinePatchDrawable getNinePatchDrawable(Context aContext, int aNinePatchResourceId) { Bitmap bg = BitmapFactory.decodeResource(aContext.getResources(), aNinePatchResourceId); NinePatch np = new NinePatch(bg, bg.getNinePatchChunk(), null); NinePatchDrawable t9Patch = new NinePatchDrawable(aContext.getResources(), np); return t9Patch; }