List of utility methods to do Bitmap to Drawable Convert
Drawable | bitmap2Drawable(Bitmap bitmap) bitmap Drawable Drawable drawable = new BitmapDrawable(bitmap); return drawable; |
Drawable | from(Bitmap bitmap) from BitmapDrawable bitDrawable = new BitmapDrawable(bitmap); return bitDrawable; |
Drawable | BitmapToDrawable(final Bitmap bitmap) Bitmap To Drawable BitmapDrawable bd = new BitmapDrawable(bitmap); return bd; |
Drawable | bitmapToDrawable(Bitmap bitmap) bitmap To Drawable BitmapDrawable mBitmapDrawable = null; try { if (bitmap == null) { return null; mBitmapDrawable = new BitmapDrawable(bitmap); } catch (Exception e) { e.printStackTrace(); ... |
TransitionDrawable | bitmapToTransitionDrawable( Bitmap bitmap) bitmap To Transition Drawable TransitionDrawable mBitmapDrawable = null; try { if (bitmap == null) { return null; mBitmapDrawable = new TransitionDrawable(new Drawable[] { new ColorDrawable(android.R.color.transparent), new BitmapDrawable(bitmap) }); ... |
Drawable | geRoundDrawableFromUrl(String url, int pixels) ge Round Drawable From Url byte[] bytes = getBytesFromUrl(url); BitmapDrawable bitmapDrawable = (BitmapDrawable) byteToDrawable(bytes); return toRoundCorner(bitmapDrawable, pixels); |
StateListDrawable | bgColorDrawableSelector(Bitmap nomal, Bitmap focus) bg Color Drawable Selector BitmapDrawable nomalBitmap = new BitmapDrawable(nomal); BitmapDrawable focusBitmap = new BitmapDrawable(focus); StateListDrawable selector = new StateListDrawable(); selector.addState(new int[] { android.R.attr.state_pressed }, focusBitmap); selector.addState(new int[] { android.R.attr.state_selected }, focusBitmap); selector.addState(new int[] { android.R.attr.state_focused }, ... |
Drawable | bitmapToDrawable(Bitmap bitmap) bitmap To Drawable BitmapDrawable mBitmapDrawable = null; try { if (bitmap == null) { return null; mBitmapDrawable = new BitmapDrawable(bitmap); } catch (Exception e) { e.printStackTrace(); ... |
TransitionDrawable | bitmapToTransitionDrawable( Bitmap bitmap) bitmap To Transition Drawable TransitionDrawable mBitmapDrawable = null; try { if (bitmap == null) { return null; mBitmapDrawable = new TransitionDrawable(new Drawable[] { new ColorDrawable(android.R.color.transparent), new BitmapDrawable(bitmap) }); ... |