Return to Snippet

Revision: 43179
at March 18, 2011 14:13 by sospartan


Initial Code
NinePatchDrawable drawable = (NinePatchDrawable) context.getResources().getDrawable(R.drawable.btn_default_normal);
paint.setColor(Color.BLUE);
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);
Canvas c = new Canvas(b);
drawable.draw(c);
canvas.drawBitmap(b, new Rect(0, 0, width, height), rect, paint);

Initial URL

                                

Initial Description

                                

Initial Title
android ninepatchdrawable draw scalable

Initial Tags
android

Initial Language
Java