/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
NinePatchDrawable drawable = (NinePatchDrawable) context.getResources().getDrawable(R.drawable.btn_default_normal); int width = (int)this.mRect.width(); int height = (int)this.mRect.height(); drawable.setBounds(new Rect(0, 0, width,height)); Bitmap b = Bitmap.createBitmap(width, height, Config.ARGB_8888); drawable.draw(c); canvas.drawBitmap(b, new Rect(0, 0, width, height), rect, paint);