Lines Matching refs:drawable
27 import android.graphics.drawable.BitmapDrawable;
28 import android.graphics.drawable.Drawable;
114 * Get a copy of bitmap of given drawable, return null if intrinsic size is zero
116 public static Bitmap createDrawableBitmap(Drawable drawable) {
117 int width = drawable.getIntrinsicWidth();
118 int height = drawable.getIntrinsicHeight();
123 if (drawable instanceof BitmapDrawable && scale == 1f) {
125 return ((BitmapDrawable) drawable).getBitmap();
131 Rect existingBounds = drawable.getBounds();
136 drawable.setBounds(0, 0, bitmapWidth, bitmapHeight);
137 drawable.draw(canvas);
138 drawable.setBounds(left, top, right, bottom);